stoecher@xxxxxx wrote:
Hi,
I am new to git and I am wondering what git commands to use for
> this szenario: two developers without the possibility of sharing
> a server communicate their changes via email.
>
This is how far I have come reading the online docu:
* Each developer can create the diff-info of his commits with
git format-patch
* and the other developer can incorporate these changes with
git am
After creating the patches with format-patch one could set a tag:
git tag -f patchesDone
so next time one wants to create patches, this tag can be used as the starting point:
git format-patch patchesDone..
I wonder if it would be easier to maintain a separate branch containing
changes which you have both integrated. Suppose you call it "master".
And then do your own work on another branch called "private". Then when
you want to send all your new work, you can just do:
git format-patch master..private
possibly threading the messages, etc.
When your collaborator has acknowledged receipt of the patches, you put
them on your master also, and rebase your "private" branch. If the
patch doesn't apply cleanly for your collaborator, you'd need to apply
your collaborator's resolution to your master instead of your original
patch. Or you could apply whatever work your collaborator has that is
conflicting with your own patch, and resolve the conflict yourself.
I would expect you can periodically verify that your "master" source
code is synchronized by comparing tree hashes, even though the commit
hashes may differ.
I imagine you might find that your patches might sometimes have a
different order than your collaborator's if your emails cross, and their
commit hashes may differ. But I expect that would mostly work out ok.
You could probably verify that your "master" source code is synchronized
by comparing tree hashes from time to time, even though the commit
hashes may differ.
You could even split your work among several "feature branches". But
one piece of information that "git format-patch" does not advertise, but
which "git push" does, is the branch that a patch should be applied to.
So if your protocol is email-only, and you want to share many branches
with your collaborator, you'd have to communicate that explicity in the
email.
But what if in the meantime one has incorporated the other
> developer's changes with git am? Then these changes will also
> be among the patches created with format-patch. What will
> happen, if these patches are sent to the other developer,
who does not need his own changes again. Will his own changes
> be silently ignored by git am?
Yes, provided the actual code changes in the duplicate patch are exactly
the same, git am will skip it, even if the committer, timestamps, or
comment are slightly different.
Marcel
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html