Created
May 6, 2024 22:05
-
-
Save iainmerrick/d2a8480a693ae6b7de6053e5ecd72f53 to your computer and use it in GitHub Desktop.
Cherry-pick git commit including all metadata
This file contains 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 characters
#!/bin/bash | |
export GIT_AUTHOR_NAME=`git show --quiet --format="%an" $1` | |
export GIT_AUTHOR_EMAIL=`git show --quiet --format="%ae" $1` | |
export GIT_AUTHOR_DATE=`git show --quiet --format="%ad" $1` | |
export GIT_COMMITTER_NAME=`git show --quiet --format="%cn" $1` | |
export GIT_COMMITTER_EMAIL=`git show --quiet --format="%ce" $1` | |
export GIT_COMMITTER_DATE=`git show --quiet --format="%cd" $1` | |
git cherry-pick -n $1 | |
git commit -n -C $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment