Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
I love `git commit --fixup`
# Have origin be your fork, upstream is upstream.
$ git remote -v
origin git@github.com:jbeda/kubernetes.git (fetch)
origin git@github.com:jbeda/kubernetes.git (push)
upstream git@github.com:kubernetes/kubernetes.git (fetch)
upstream git@github.com:kubernetes/kubernetes.git (push)
# Make some changes to a bunch of files in a multi commit PR
# Find the commit you want to tweak, copy the hash
$ git log
# Commit that file with the `--fixup` flag.
$ git add file.go
$ git commit --fixup f6d3505ddc6c3944b354cf3f4f2583e6c8775581
# Now rebase (without a fetch) to automatically squash the fixup commits
$ git rebase -i --autosquash upstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.