Created
February 6, 2024 19:28
-
-
Save cmackenzie1/7743a88eb95fef330d45a0f37b145f17 to your computer and use it in GitHub Desktop.
Revisions
-
cmackenzie1 created this gist
Feb 6, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ ## Copy last commit message to clipboard ```bash git log -1 --pretty=%B | pbcopy # Can also specify -2 for last two messages. ``` ## Is it `master` or `main`? ```bash git branch -l master main # Do it all in one step git fetch --all && git rebase -i origin/$(git branch -l master main) ``` ## Reuse previous commit message after `git reset` ```bash git commit --reuse-message=HEAD@{1} # shorter version git commit -C HEAD@{1} # even shorter! git commit -C@@{1} ```