Question

We are looking to have a Git architecture like the following.

Git architecture

I have created two bare repositories for these.

  1. //production/repo/MyProject.git (prod-repo)
  2. //dev/repo/MyProject.git (dev-repo)

After pushing my code to the dev-repo and testing it, I want to push all the changes to prod-repo. Obviously I won't have a working directory on either of these machines? How can I push all the files in the dev-repo to prod-repo?

Was it helpful?

Solution

You don't need to have a working copy to do push and fetch operations with git, so just push as you normally would:

git push prod <branch>

Working copies are only necessary if you're going to be modifying (or possibly modifying) code (like with a commit, merge, rebase, pull, etc).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top