0

So for reasons, my small team is not able to access the server our git repo is on for the indefinite future.

We do all have local copies of the most recent changes for the repo though, and would like to continue to contribute to it. Once we have access to the server again, we would want to be able to push our changes to this server and use it like we were before.

My question is, how can we do this? I see many posts/questions about using git without a server so I believe it is possible.

My thinking is:

  1. One person will have the copy of the "final" repository on their machine

  2. When a person wants to make a change, they will send a patch file of their changes to the final repo owner.

  3. The final repo owner will then create a new branch based off master, and then apply the patch to this new branch.

  4. The final repo owner will then test the new branch

  5. Once the testing is complete, the final repo owner can merge into master.

So one question with this workflow I have is: how can the other people on the team know of the changes? If the final repo owner merges into master, how can the other members get the merge reflected in their repos?

Any guidance or criticism is appreciated.

  • 2
    You don't even need to send a patch file. The designated final repository can be pushed to and pulled from just like the original server. You'll just need an appropriate URL. – chepner Mar 16 '20 at 16:56
  • @chepner thanks for the response. That is a good idea. I assume this would require either https or ssh to be open on the target computer though? –  Mar 16 '20 at 16:59
  • 1
    Can you access some other server? Remember, every copy of the repo has the _whole history_. Like when my repo at oreilly media went down during the fires last year I just moved everything to bitbucket. So it is easy to change remotes. – matt Mar 16 '20 at 17:01
  • 1
    Correct. Patch files may make it a little easier to handle patch submissions if the final repository is, for example, a laptop that may not always be on. – chepner Mar 16 '20 at 17:01
  • @matt We would not be able to put it on a different server unfortunately. –  Mar 16 '20 at 17:02
  • Yeah, understood. :) – matt Mar 16 '20 at 17:20

2 Answers2

0

Git has a complete copy of the repository on your computer. Assuming you don't want to try and share in the meantime, continue working as normal. Push once you have access to the server again.

If you're all making changes to master (or any single branch) that increases the risk of conflicts, so make sure to use well-defined feature branches.


If you do want to coordinate, you could do as you suggest and send patch files to a designated integrator. Git has an extensive email workflow. But patch files lose much of the power of Git. And you still need a way for the integrator to distribute changes back downstream to everyone.

The simplest thing to do is to set up a new, temporary Git server. This requires only ssh access. Set that as origin and work with that. This is more secure and far, far less error prone than emailing patch files around.

Once you have access to the main server again you can push your changes straight to it. You all have a complete copy of the repository and you will all be able to reconstitute it.

Schwern
  • 153,029
  • 25
  • 195
  • 336
0

We found a solution that is very specific for our case, but if we couldn't do that we would have used git bundle