Vidura Mudalige
Vidura Mudalige

Reputation: 822

What is the best way to handle tree conflicts in Git?

I am following the git-flow workflow model for the version controlling. While I was working in a feature branch, someone else merged another feature branch to develop branch which contains some tree changes of the project. Now the project structure in my feature branch is different from the structure of the develop branch (eg: In my feature branch I am working in a file located in,

"com.translators.components"

. But in the develop branch the file is located in,

"modules.com.translators.components"

). When I took a pull from the develop branch, git showed very big number of conflicts since many file locations have been changed.

Upvotes: 1

Views: 3276

Answers (1)

gzh
gzh

Reputation: 3616

Because of changes on project structure, it is very difficult to merge automatically. you have to do merging manually by yourself. The following command will be helpful.

1) you can run git fetch to retrieve remote modifications without merge to your local work tree.

2) commands as git checkout master -- component.java will copy files from other branch to your work tree.

3) git diff branchA:branchB --name-status will show filename list with status between two branches.

Then reorganize your local work tree to follow remote modifications manually.

Upvotes: 2

Related Questions