Skip to content

Instantly share code, notes, and snippets.

@sean-gilliam
Created December 20, 2018 22:48
Show Gist options
  • Save sean-gilliam/e0caa4f3ea7a8291dfedda2ba669e16b to your computer and use it in GitHub Desktop.
Save sean-gilliam/e0caa4f3ea7a8291dfedda2ba669e16b to your computer and use it in GitHub Desktop.
Import an existing repo into a fresh repo

git original repo c:\src\repos\<old_repo_name>

  • go up one directory cd ..

  • clone new repo into sibling directory - git clone <url> <new_repo_name>

  • cd to new directory - cd <new_repo_name>

  • add new git remote - git remote add old ..\<old_repo_name>

  • fetch from old repo - git fetch old

  • pull from old master - git pull old master

  • force push to new repo - git push -f origin

  • remove old git remote - git remote rm old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment