Jacob Kranz
Jacob Kranz

Reputation: 951

pushing from one --bare repo to another --bare repo on same server

I have a remote repo on a server that I push to for staging purposes. I then have a post-receive to push that to the file directory where http://stage.xxxx.com files live on.

Now that I have everything on my staging repo and it's presumed to be bug free, how do I push it from my staging repo to my live repo on the same server?

I would prefer to not have to push my local code directly to the production git repo because I'm shall we say not the best at keeping track of that kind of stuff. Would I have to login directly to the server and do a push from there to the live repo?

Upvotes: 0

Views: 441

Answers (1)

Chronial
Chronial

Reputation: 70673

Yes, you would have to log in directly to the server, and that solution seems a little bit overcomplicated, because you can just do something like this:

git fetch --all
git push livesite staging/master:master

This will push the state of staging/master to livesite/master and you do not have to keep track of anything.

Upvotes: 1

Related Questions