Bitbucket: conflict in remote repo, can't figure out how to resolve

I hope I can express it correctly ... I have the following setting in Bitbucket (using the Git protocol). I have a main repo that contains my application. Then I fork the master repo for each client so that I have the flexibility to make specific changes to the client without affecting the wizard. When a general change is required, I click on the wizard, and then synchronize with the plug, and then make a conclusion to production.

The problem I am facing is that on Bitbucket it says that I have merge conflicts, but I don’t know how to resolve them. At the local level, I have no conflicts. When I enter the beatbucket, it tells me that I have 2 commits for the master repo, so I click sync. It talks about the merging of conflicts, and I need to resolve them. Then I see no way to resolve these conflicts. If I deal with a production server, it talks about conflicts, and I need to resolve them, so I do it. I go in with nano (as I hate VIM) and clean up what I need and go about my business. But the forked repo is still in conflict. I do not know what I need to do to resolve this situation. Despite everything, he stalled because I can no longer change the plug until the conflicts are resolved.

+7
git bitbucket git-merge merge-conflict-resolution
source share
1 answer

When working with a fork, it is often useful to have an upstream repository (your main repository) configured with both remote and fork (client A repository). For example, you probably already have origin , which is a fork.

Add a new upstream console to present the Master repository:

 git remote add upstream git@bitbucket.org :user/master-repo.git git fetch upstream 

You should now be able to see all the relevant branches. For example, if you try to merge the master branch, this will matter:

  • master (local)
  • origin/master (Client A)
  • upstream/master (master repo)

If you visualize these branches using gitk or git log --all --graph --decorate , you can probably see where the conflict is coming from. Most likely, you will want to merge the changes from both remotes into the local master branch:

 git checkout master git merge upstream/master # (Merge changes from the "Master" repo) # Fix any merge conflicts that may arise git merge origin/master # (Merge changes from the Client A repo) # Fix any merge conflicts that may arise 

Once you do this, you should be push purely origin :

 git push origin master 
+10
source share

All Articles