Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push everything to new origin

Tags:

git

branch

commit

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

like image 538
Kevin Avatar asked Oct 03 '11 02:10

Kevin


People also ask

How do I push all branches to a new remote?

To push the all branches to a remote git, we can use the git push command followed by the --all flag and origin. This will create a track with the local branches to the remote branches.

What is git push origin -- all?

If you use git branches a lot, you'll often push each branch after each commit. This takes time… Instead of pushing every single branch you can do git push --all origin . This will push all commits of all branches to origin. That really simple!

How do I push origin to new repo?

Run the git remote set-url --add --push origin git-repository-name command where git-repository-name is the URL and name of the Git repository where you want to host your code. This changes the push destination of origin to that Git repository.


1 Answers

(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 
like image 172
sdive Avatar answered Sep 17 '22 17:09

sdive