First, create an empty repository. Then, you can either import project from the web UI or push your existing repository from the command line.
1.Check your current remote URL by: git remote -v
ex:
git remote -v
origin https://github.com/USERNAME/REPOSITORY.git (fetch)
origin https://github.com/USERNAME/REPOSITORY.git (push)
2.Set URL by: git remote set-url <url>
ex:
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
3.Now, check your remote URL again:
ex:
git remote -v
origin https://github.com/USERNAME/OTHERREPOSITORY.git (fetch)
origin https://github.com/USERNAME/OTHERREPOSITORY.git (push)
ex:
git remote set-url origin git@github.com:USERNAME/OTHERREPOSITORY.git
4.All done! Try git push
or git fetch
to contribute to the new remote repository.