Skip to content

Instantly share code, notes, and snippets.

@creaktive
Created June 15, 2018 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creaktive/7ff42aaa2a5c0f4dd0eebb65ab236f72 to your computer and use it in GitHub Desktop.
Save creaktive/7ff42aaa2a5c0f4dd0eebb65ab236f72 to your computer and use it in GitHub Desktop.
Manually transfer all the commits from one git repo to another
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