Skip to content

Instantly share code, notes, and snippets.

@SWBSanjeewa
Last active July 9, 2018 07:08
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 SWBSanjeewa/80591696b90839aeacbee7abecded860 to your computer and use it in GitHub Desktop.
Save SWBSanjeewa/80591696b90839aeacbee7abecded860 to your computer and use it in GitHub Desktop.
Create new git repository from existing git repository
Clone original repository
Check current remote url
>git remote -v
Set new remote url
>git remote set-url origin <new_git_repo_url>
Push all branches to new repository
git push -u origin --all
Push all tags to new repository
git push origin --tags
Switch to another branch
git checkout origin/new_branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment