0

I'm working for a client who has their own secure git repository, which is only accessible by a VPN connection. My company has its own secure VPN, where our GIT server resides. Some colleagues don't have access to the client's repo and updating our repo is very time-consuming.

I wrote a small sh script that asks us to connect to the client's VPN, and once connected it fetches all relevant repos. The script then asks us to disconnect and connect to our own VPN, after which the script must push the changes.

I'm having trouble with this last part. How can I have git push everything I just fetched? This is not only the typical "develop" and "master" branches but also new branches with unknown names (e.g. newFeature/XXXX, where XXXX is unknown and can change).

Thanks in advance for your help!

Daniel
  • 1,321
  • 12
  • 25

1 Answers1

0

See "Set up git to pull and push all branches", which includes, as commented:

git push --all origin

In your case:

git push --all -u

if you add -u once, e.g. git push --all origin -u, tracking is setup and after that you can simply use git push.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250