+1 vote
1 view
in DevOps and Agile by (20k points)

I have a local Git repo that I would like to push to a new remote repo (brand new repo set up on Beanstalk, if that matters). My local repo has a few branches and tags and I would like to keep all of my histories. It looks like I basically just need to do a git push, but that only uploads the master branch. How do I push everything so I get a full replica of my local repo on the remote?

1 Answer

+1 vote
by (28.4k points)

In order to push all your branches, use the following command 

Say, the remote is "origin":

$ git push REMOTE '*:*'

$ git push REMOTE --all

In order to push all your tags:

$ git push REMOTE --tags

Also, these things can also be done with the help of this single command:

$ git push REMOTE --mirror

Note that: --mirror, will push your remotes as well, so this might not be exactly what you want.

by (9.6k points)
This answer worked for me. Thanks a lot.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !