3 ms·
That is true -- thanks for pointing that out. I generally don't do pushes without first handling all the local changes, one way or another (either committing th
by mechanical_fish 18y ago
That is true -- thanks for pointing that out. I generally don't do pushes without first handling all the local changes, one way or another (either committing them or deleting them) so this possibility had not occurred to me. But it is there.
I'm guessing that you could fiddle with git's hooks to discourage or even prevent this problem, if you wanted to. For example, you could refuse to allow "git push" to be run from within a repository that contains uncommitted changes, and also include a requirement that your tests pass before the push commences.
- jackowayed 18y agoI do sometimes. Usually it's when I do one thing, then start another, then realize that I really should push the old thing first. So I add the old thing I did, commit, test (when I test. sometimes I'm bad and don't have real tests.) and push, leaving this half-finished method uncommitted. I guess I really should just git stash. C does not have nearly as many useful things built in as git.