3 ms·
I’ve been using this: alias gfixup="git commit -v --fixup HEAD && GIT_SEQUENCE_EDITOR=touch git rebase -i --stat --autosquash --autostash HEAD~2" From what I
by johnnypangs 2y ago
I’ve been using this:
alias gfixup="git commit -v --fixup HEAD && GIT_SEQUENCE_EDITOR=touch git rebase -i --stat --autosquash --autostash HEAD~2"
From what I understand it does the same thing as this crate for the most part. All I do after is:
git push —force-with-lease
Not sure what you get from the crate otherwise
- johnnypangs 2y agoI guess the crate version is easier to soft reset?
- masklinn 2y agoYour alias seems like a completely unecessary complexity. If you want to meld new changes into your branch head you can just alias “git commit --amend”, you don’t need that mess. Absorb will find the commits to fix up for each change in the working copy, it doesn’t just merge everything into the head.
- johnnypangs 2y agoI see, the reason it’s that long complicated alias was that I didn’t want to open up the editor to change the commit every time I updated. “git commit —amend” does that. I read the rough how it works and it now makes sense. I might give it a try. Thanks!
- johnnypangs 2y agoSeems like you can add —no-edit and get the same behavior, now I can delete that alias. Thanks again :) (Edit: typo)
- masklinn 2y agoThat is correct, and there is a `--edit` to revert that, so my personal alias is to `git ci --amend --no-edit` such that by default it just merges the staging into the HEAD, and then tacking on `-e` will open the commit message in an editor to expand it.
- cryptonector 2y agoYou can also set `EDITOR=true` for that `git commit --amend` if you forget about `--no-edit`.
- deleted 2y ago[deleted]