0

When I run "git merge" from dev-A tp dev-B, I input the following commands in the console.

git checkout dev-A
git checkout dev-B
git merge dev-A &> LOG

And after that, what can i get in the LOG is the program (file) name, like the pom.xml or Gather.java as the following content in LOG, which has been changed in branch dev-A, whether it just fast forward into the dev-B or make conflicts when merging.


LOG :

twd-place:
Updating c6157fg..8eceqaa
Fast-forward
 pom.xml                                        | 223 +++++++++++----------
 .../auto/srf/place/PlaceAutoServiceImpl.java   |  26 ++-
 .../auto/srf/place/srf_auto_place.xml          |  23 ++-

twd-head:
Updating 082a5cd..cr2dedc
Fast-forward
 pom.xml                                        |  26 +-
 .../gather/Gather.java                         |  44 ++-

Auto-merging src/main/scripts/TWD.properties
CONFLICT (content): Merge conflict in src/main/scripts/TWD.properties
Auto-merging src/main/resources/com/twd/head/config/discovery.xml
CONFLICT (content): Merge conflict in src/main/resources/com/twd/head/config/discovery.xml

I'll use sed to edit the LOG, and the result is like that:


LOG :

twd-place:
pom.xml
.../auto/srf/place/PlaceAutoServiceImpl.java
.../auto/srf/place/srf_auto_place.xml

twd-head:
pom.xml
.../gather/Gather.java
src/main/scripts/TWD.properties
src/main/resources/com/twd/head/config/discovery.xml

But I want the program (file) name list without the program (file) whose codes just are changed in the dev-A only. It means I want the program list whose codes are modified both in dev-A and dev-B, including the one which make confilcts in merging and the other one not.

I draw a picture to discuribe the situation.

For example, the program (file) .../auto/srf/place/PlaceAutoServiceImpl.java is modifed only in dev-A, so I need to delete it. It means .../auto/srf/place/PlaceAutoServiceImpl.java is the blue part in the picture, which I don't need. And src/main/scripts/TWD.properties is modified both in dev-A and dev-B, for which conflicts ouccr. It's the red part. And .../gather/Gather.java is also modified both in dev-A and dev-B while no error comes. it's the green part.

So how can I get the green part and the red part in the picture, or delete the blue part.

enter image description here

Cink Zhang
  • 11
  • 3

0 Answers0