Created
June 15, 2018 06:47
-
-
Save creaktive/7ff42aaa2a5c0f4dd0eebb65ab236f72 to your computer and use it in GitHub Desktop.
Manually transfer all the commits from one git repo to another
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
mv .git .git.tmp && \ | |
mv .git.bak .git && \ | |
mv .git.tmp .git.bak && \ | |
git checkout . && \ | |
git checkout $(git rev-list --topo-order HEAD..master | tail -1) && \ | |
CMSG=$(git show -s --format=%s) && \ | |
export GIT_COMMITTER_DATE=$(git show -s --format=%cd) && \ | |
export GIT_AUTHOR_DATE=$(git show -s --format=%ad) && \ | |
mv .git .git.tmp && \ | |
mv .git.bak .git && \ | |
mv .git.tmp .git.bak && \ | |
git add . && \ | |
git commit -m "$CMSG" && \ | |
git show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment