I deleted my previous git origin, and created a new one. I did git add . and git commit. But it will update changes, how do i push everything into the new origin
Asked
Active
Viewed 4.2k times
4 Answers
85
(works with git 1.8.4)
If you want to push all branches at once:
git push <URL> --all
To push all the tags:
git push <URL> --tags

sdive
- 2,047
- 1
- 20
- 20
-
5When I do this in git 1.8.4, it only pushes the branches. To push the tags, I need to do: git push
--tags – hypehuman Apr 30 '14 at 00:07
4
git remote add origin <address>
git push origin <branchname>

Chris Kooken
- 32,730
- 15
- 85
- 123
-
3You probably also want to add `--track master` to that first command, assuming you intend to push to/pull from the new origin. So: `git remote add --track master origin ` – bjnord Feb 27 '12 at 14:56
-
7This just pushes the specified branch. no other branches, no tags. Downvoted – NicoPaez Feb 28 '17 at 03:13
-1
Hmmmm I just did this. I am not sure if you did exactly the same but I had a different method.
I setup a bare repo on "newserver" (using ssh). Had the full clone of the repo on my laptop.
I then did:
git remote set-url origin "newservers url"
git push origin master

David Ward
- 15
- 1