1

I have a website developed by a third-party company. It is under Git, but repo is on their own server which I do not have access to. Both myself and this company would want to have site code under it and both parties want to be able to commit or roll out changes.

So, my idea is to create an intermediate Git repo somewhere on my server. My changes will be committed to this repo, while third-party company will be committing to this repo AND pushing the changes up to their server if needed. Also, if there are any changes they need to push down, they will be able to do so by pushing it to my intermediate repo first, then to live site.

Two questions:

  1. Is what I am proposing make sense? If not, is there a better way?
  2. If it does make sense, how do I add intermediate repo?
Biffen
  • 6,249
  • 6
  • 28
  • 36

2 Answers2

0

Kinda, when using git you can have multiple remote server to push to beside origin which is the name of the default remote repo. So the company will push to a common repo and keep sync their own private repo, while you'll use the common repo also. Make sure you fetch and pull often to avoid merge conflicts.

Dr4ke the b4dass
  • 1,184
  • 2
  • 17
  • 40
0

That solution makes sense: define a common referential (here a Git repo) you both have access to.
Note that even if you didn't have any way to access a common repo, you could still exchange commits through a git bundle (a repo compressed as one file, from which you can pull from)

But in that kind of scenario, new commits are best pushed in dedicated branch: you push to companyA branch, they push their commit to companyB branch.

Once you fetch from that common repo, you can then reconcile (merge) origin/companyB to your own branch, make your new commits, and push back, but on companyA branch.

That way, you resolve any conflict locally, and can push without issue at any time, allowing for concurrent work.

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