Skip to content

Instantly share code, notes, and snippets.

@cgddrd
Created May 3, 2013 13:37
Show Gist options
  • Save cgddrd/5509147 to your computer and use it in GitHub Desktop.
Save cgddrd/5509147 to your computer and use it in GitHub Desktop.
Transferring of entire repository (including history) to new repository in Git.
git clone <git repository B url> /* Clone and enter the new repo. */
cd <git repository B directory>
git remote add repo-A-branch <git repository A url> /* repo-A-branch (e.g. master) (No chevrons required) */
git pull repo-A-branch master
git remote rm repo-A-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment