4 ms·
Weird they don't talk of the `git commit --fixup=` command. And then `--autosquash` when rebasing.
by sktrdie 7y ago
Weird they don't talk of the `git commit --fixup=` command. And then `--autosquash` when rebasing.
- masklinn 7y agoAlso no mention of `--onto` to e.g. move a bunch of commits from one branch to an other.
- Sir_Cmpwn 7y agoI don't use --fixup in my own workflow, but I would be happy to accept a patch adding a note about it: https://git.sr.ht/~sircmpwn/git-rebase.io https://git.sr.ht/~sircmpwn/git-rebase.io
- umvi 7y agoIs --fixup the same as --amend?
- Liskni_si 7y agoConceptually, it's similar, and after git rebase --autosquash, the result is the same. But you can amend/fixup (call it whatever you want) any commit in your branch, not just the last one.
- u801e 7y agoYou can achieve the same thing by just titling the commit: fixup! Exact title of commit We actually use that workflow during PR reviews on Github. That is, someone comments on a PR and the person who opened the PR will make a fixup commit with the appropriate title and reply to the comment stating that it was addressed and link the fixup commit by its abbreviated sha1 value. At the end of the PR review, the person who will merge the PR will run: git fetch origin git rebase -i --autosquash origin/master git diff @{u}.. This basically updates the remote tracking branches (including origin/master), rebases the feature branch on top of the remote tracking branch for master, and then checks if any changes were introduced in the rebase process by running a diff against the remote tracking branch. If there is no diff or the diff only shows changes made on the upstream master branch since the feature branch was created, then they can run: git push -f origin feature-branch-name and then merge the PR.