How to see changes during "merge conflict" in git rebase

I delete the file in my working directory. And then I do git pull. Another person on my team modifies the same file and "git push" in HEAD.

So, when I do "git rebase", I get a merge conflict something like "CONFLICT git (delete)"

My question is, how can I find out what changes the other person made in the command in the “delete” file?

Thanks.

+5
source share
3 answers

In case of a conflict during merge or redirection, different versions of the file are available:

  • corresponding branches:

    $ git show HEAD:path/to/file
    $ git show branch:path/to/file
    
  • as steps 1, 2, 3 in the index:

    $ git ls-files --unmerged  
    # ...
    $ git show :1:path/to/file
    $ git show :2:path/to/file
    

, "git diff --cc" "git log --merge".

. .

+7

Git upstream " ". git branch -r, . , , , - :

git diff HEAD^..origin/master

HEAD ( , ) .

+4

. Pull . , , , .

Our normal development is to have one GIT repository from which everyone is collapsing. I recommend rebasing instead of pulling from a central repository. This is because if you select from the repository, then reinstall it into the same repository, then your commits that you sent to the repository will conflict with your current branch. Usually it was easier for us if you need to use pull or push, instead use patches.

For example .. Never reinstall from the repository from which you pulled.

0
source

All Articles