Created
March 8, 2012 14:40
-
-
Save a-bx/2001283 to your computer and use it in GitHub Desktop.
Copy git repositories with all history
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
#Origin | |
$ git clone <origin repo> | |
$ cd <origin directory> | |
$ git remote rm origin | |
$ git filter-branch --subdirectory-filter ./ -- --all | |
$ git add . | |
$ git commit | |
$ pwd | |
#Target | |
$ git clone <target repo> | |
$ cd <target directory> | |
$ git remote add origin-repo <origin directory> | |
$ git pull origin-repo master | |
$ git remote rm origin-repo | |
$ git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much!
It is very helpful!
But I have a simple question...
Is this different from git bare?