38

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

tshepang
  • 12,111
  • 21
  • 91
  • 136
Kevin
  • 1,574
  • 4
  • 19
  • 45

4 Answers4

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
  • 5
    When 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
  • 3
    You 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
  • 7
    This 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
-2

git push new_remote_name branch_name

Lem Ko
  • 413
  • 4
  • 13