I have a codeline with certain change number A. I
git init on it and I edit some files and then add
p4 opened files by
git add and then
git commit to my local repository.
There's another guy working on the SAME codeline with different change number B. He also edited some files, some of which are common files between us and he also did the
git add and
git commit to his local repository.
We don't have a central global repo in the first place. But now I want to merge his git changes into my client. How can this be done via git?
First you need some kind of access to his repo. A simple shared directory is enough. Other options are detailed here.
Then you need to clone his repo (B) in order to get all the changes.
You can make a branch in your own repo A, and git add everything checked out by the second repo B.
A trick to do that easily is to:
git checkout --orphan branchForB: see this SO answer as an example.
--work-tree=<path>option to git to add files from other directory:
git --work-tree=/path/to/file add ., as mentioned in "How can I create a new branch in git from an existing file tree?"
Once that is done: