Collaborate with peers who don't use git

While I use git for all my projects, sometimes I have to work with colleagues who do not use git. They prefer to send their mail archives back and forth. It is annoying and cumbersome, but I have to deal with it. The workflow is as follows:

When they need my code, I use git archive and send them the export.zip zip file. I continue to work and make the changes that I make while they work with my outdated sources. Illustration:

  β”Œ archive & mail β”‚ A ← B ← C └───┴── my later changes 

After some time, they sent me their import.zip response import.zip . How to import a zip file into a git tree and how to implement it? . I can imagine the following three parameters that differ semantically:

  • Consider my later changes based on their changes:

      β”Œ archive & mail β”‚ A ← A' ← B ← C β”‚ └───┴── my later changes β”‚ └─ their changes 

    Here I would check A , unzip import.zip , commit as A' , and then reapply B and C (and all that after that). How can I resubmit before HEAD ?

  • Consider their changes based on my later changes:

     A ← B ← C ← A' 

    Here I would create a patch based on the difference between A and import.zip and apply this to C

  • Create a branch and merge:

     A ← B ← C ← M β†– ↙ A' 

    When writing this question, I came to the conclusion that this option is the most generally applicable and most reliable. Do you agree?

I am grateful for other recommendations regarding this workflow. For example, I find it tedious and error prone to remember the commit A that I archived.

+7
git
source share
3 answers

You are right, # 3 is the best. I would create a branch for each person who could send you changes. Issue their branch, unzip the archive and make changes to their branch. At some point, you can merge your changes with your changes, and git will indicate conflicts for you, which is obviously not optimal, but relatively normal, considering that you are dealing with people sending mail by mail. When you are ready to send them the latest changes, I would recommend a commit tag that you archive as β€œ collab-zip-<date> ” or something else with a tag message that says: β€œSubmitting changes to X, because what Y ". This answers your last bit on how to track what you sent when.

+3
source share

I find it tedious and error prone to remember the commit A that I archived.

Create an export branch and do your work in another branch. Whenever you are ready to send to your colleagues, you can simply combine your latest versions into export and archive them. I would suggest using this in combination with option number 3.

And you also forgot option # 4: convince your colleagues to use Git, offering to help them set up and start with it. Teach a person to fish, etc.

+1
source share

As other people have already noted, No. 3 is the second best solution. This is about the same as using Git, too, only then will you merge remote branches instead of local ones, and they will probably have several commits instead of one.

Of course, you could repackage your commits on top of your changes (according to your first option), but then you rewrite the story, which will pose many other problems.

I would not suggest using manual corrections (option number 2). Git has a very good merge tool designed for these situations.

*: The best solution still is to convince your colleagues to start using Git. Right now you are spending a lot of time and effort because of your preferences. If they don’t want to listen to you, just talk to your boss and tell him that you spend a lot of time because of their stubbornness and that he has a higher risk of introducing errors, and that (well, I suppose you can come up with a few more arguments to convince him that it will save money).

+1
source share

All Articles