Skip to content

Instantly share code, notes, and snippets.

@alexanderbird
Last active November 16, 2020 01:14
Show Gist options
  • Save alexanderbird/d2faac0b0f040596d3af095211b127ce to your computer and use it in GitHub Desktop.
Save alexanderbird/d2faac0b0f040596d3af095211b127ce to your computer and use it in GitHub Desktop.
Experimenting with git commit --fixup as described in https://twitter.com/jaybazuzi/status/1328091226415894531
 /tmp/fixup ☛ git branch start
 /tmp/fixup ☛ date > $(date +%s) # create a new file with the current date in it, just for something to commit
 /tmp/fixup ☛ git add -A && git commit --fixup start -a
[master c037a95] fixup! good
1 file changed, 1 insertion(+)
create mode 100644 1605488610
 /tmp/fixup ☛ date > $(date +%s)
 /tmp/fixup ☛ git add -A && git commit --fixup start -a
[master 26f9ec1] fixup! good
1 file changed, 1 insertion(+)
create mode 100644 1605488621
 /tmp/fixup ☛ date > $(date +%s)
 /tmp/fixup ☛ git add -A && git commit --fixup start -a
[master 59d3e58] fixup! good
1 file changed, 1 insertion(+)
create mode 100644 1605488624
 /tmp/fixup ☛ date > $(date +%s)
 /tmp/fixup ☛ git add -A && git commit --fixup start -a
[master 4ae24a7] fixup! good
1 file changed, 1 insertion(+)
create mode 100644 1605488626
 /tmp/fixup ☛ git la
* 4ae24a7 [Alexander Bird, 8 seconds ago] (HEAD -> master) fixup! good
* 59d3e58 [Alexander Bird, 10 seconds ago] fixup! good
* 26f9ec1 [Alexander Bird, 12 seconds ago] fixup! good
* c037a95 [Alexander Bird, 19 seconds ago] fixup! good
* 9416345 [Alexander Bird, 40 seconds ago] (start) good
* 6ec2d9d [Alexander Bird, 5 minutes ago] Initial commit
 /tmp/fixup ☛ git rebase -i start^ --autosquash
hint: Waiting for your editor to close the file...
# Note: I did not make any changes in vim -- just save and exit. 🧙
Press ENTER or type command to continue
Successfully rebased and updated refs/heads/master.
 /tmp/fixup ☛ git la
* a0c8e05 [Alexander Bird, 54 seconds ago] (HEAD -> master) good
| * 9416345 [Alexander Bird, 54 seconds ago] (start) good
|/
* 6ec2d9d [Alexander Bird, 5 minutes ago] Initial commit
 /tmp/fixup ☛
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment