Git Undo
11–20 of 175 posts
Re: Git Undo
#12Nice idea! The only non intuitive thing might be, that calling e.g. 'git undo' twice doesn't undo the last two changes, but the first undos the last change and the second one undos the undo.
Re: Git Undo
#13I worry about naming a function undo that doesn't necessarily undo what the user expects. Undo has a strong user expectation, and I'm not convinced this matches that.
Re: Git Undo
#14Most git command-lines are lengthy enough to give me time to consider them, so I don't often feel the need to "take back" a git invocation. What I do often screw up, though, is the (almost hypnotic) tapping of y/n when doing a `git {add, reset, checkout} -p` to prepare and clean up a commit. Ideally, with all of the -p commands, git wouldn't actually apply any of the changes I specified until it was about to quit (i.…
You'd probably really like Magit mode for Emacs then. What you're describing with interactive add becomes trivial since you can stage parts of the diff by selecting them in a region. I can hardly live without Magit these days. Bonus is that it even works on remote hosts via tramp.
[0]: https://github.com/airblade/vim-gitgutter#getting-started
Re: Git Undo
#15Warrants a big warning that using `reset --hard` will irreversibly wipe out any uncommitted changes.
Re: Git Undo
#16Re: Git Undo
#17Re: Git Undo
#18Why not just use a filesystem which supports snapshots? It would allow you to go back without even invoking git.
Re: Git Undo
#19Re: Git Undo
#20I worry about naming a function undo that doesn't necessarily undo what the user expects. Undo has a strong user expectation, and I'm not convinced this matches that.
Git already has `git branch` which doesn't in fact do any kind of branching but creates a label which follows commits when it's checked out.