I cloned a remote repository (from github) locally.
Now I want to push that local repository, to a different remote repository (that already exists). How do I do this?
I cloned a remote repository (from github) locally.
Now I want to push that local repository, to a different remote repository (that already exists). How do I do this?
I am assuming you're talking about empty repo you have created on your github (usually origin
). If it's empty, you can simply:
git push <remote-branch> HEAD
I wrote HEAD
even though you're most probably on your local master
. The difference is that HEAD
is always pushing the branch you're currently on. It can be master
or ANY other branch.
Btw, there is amazing book which covers this and much much more advanced topics and best of all - it's free: https://git-scm.com/book/en/v2
Enjoy the learning :)