Git-absorb: Git commit –fixup, but automatic
1–10 of 278 posts
Re: Git-absorb: Git commit –fixup, but automatic
#2Re: Git-absorb: Git commit –fixup, but automatic
#3> gfx='git commit --fixup $(git log $(git merge-base main HEAD)..HEAD --oneline| fzf| cut -d" " -f1)'
It shows you the commits on the current branch and lets you select one via fzf. It then creates the fixup commit based on the commit you selected.
Re: Git-absorb: Git commit –fixup, but automatic
#4I've been using this workflow with hg and it's great, happy to see a git port
Re: Git-absorb: Git commit –fixup, but automatic
#5Re: Git-absorb: Git commit –fixup, but automatic
#6FWIW, I've been using this alias for the past couple years for fixup commits, and I've been happy with it: > gfx='git commit --fixup $(git log $(git merge-base main HEAD)..HEAD --oneline| fzf| cut -d" " -f1)' It shows you the commits on the current branch and lets you select one via fzf. It then creates the fixup commit based on the commit you selected.
Re: Git-absorb: Git commit –fixup, but automatic
#7Re: Git-absorb: Git commit –fixup, but automatic
#8FWIW, I've been using this alias for the past couple years for fixup commits, and I've been happy with it: > gfx='git commit --fixup $(git log $(git merge-base main HEAD)..HEAD --oneline| fzf| cut -d" " -f1)' It shows you the commits on the current branch and lets you select one via fzf. It then creates the fixup commit based on the commit you selected.
Re: Git-absorb: Git commit –fixup, but automatic
#9FWIW, I've been using this alias for the past couple years for fixup commits, and I've been happy with it: > gfx='git commit --fixup $(git log $(git merge-base main HEAD)..HEAD --oneline| fzf| cut -d" " -f1)' It shows you the commits on the current branch and lets you select one via fzf. It then creates the fixup commit based on the commit you selected.
Re: Git-absorb: Git commit –fixup, but automatic
#10Uhm, I do a lot of git rebase -i HEAD~2 where I just squash the commit on the latest or sometimes I need to reorder and move the fix commits in specific commits in Pars that multiple commits, which I then need to push force. Is this for a similar use-case? I am not familiar with fixup or how it works.
also you can write HEAD~2 as @^^ if you want to save a couple keystrokes!