Reputation: 519
I am facing a problem in Gerrit. I am learning the Gerrit code review tool. I am using Windows.
Let me tell you whole story what happened. So you can understand better.
I have five commits in Gerrit. All are in merge conflict.
We have two branch One is master for reviewed code that is merged by Gerrit(I assume) Other is refs/for/master to review code from Gerrit.
I had push privilege today for master branch. What I did I pushed some libraries and pom.xml into master branch(I know maven will fetch dependencies from Central but These are custom one So I needed to push those with project in lib folder with system scope in pom.xml). After That I pushed same libraries in Gerrit branch that is refs/for/master
.
I am attaching screenshot for the same.
Starting two commits are merged. After that next commit(Retry commit) is showing merge conflict that has more than 100 files.
Next commit was of Pom.xml (including tibco dependency as a part of classpath) that was of libraries dependency that I added having scope system So that Maven will pick those from project lib folder.
After that next commit (addming file seperator in pom.xml to avoid conflict between windows/linux) is also in master branch. Some other use has committed. So his commit was reviewed first and merged to master branch.
After that next commit (**adding lib for tibco*) is already in master. As I said I pushed the some libraries into master branch directly.
Next two commits(polish) are also in merge conflict because of two file(I assume). but has other files beside those that are different.
How would I resolve this situation. How I can resolve merge conflict.
Beside that I also want to know about Abandon this change
button's significance. When we should use this?
Any help would be appreciated.
Upvotes: 1
Views: 1861
Reputation: 971
We have two branch One is master for reviewed code that is merged by Gerrit(I assume) Other is refs/for/master to review code from Gerrit.
You are misunderstanding how Gerrit works.
The master
branch is the branch in the git repository. The branch refs/for/master
is not a real branch, but a pseudo-branch that tells Gerrit that you want to push for review (intead of pushing directly to refs/heads/master
). Once you have approved and submitted the changes under review, the associated commits will be in the master
branch.
The Merge conflict
message appears when the commits under review conflict with the commits that are already in the master
branch.
By default, a 'conflict' only means that the same file was touched. It is possible to make it refer to actual conflict, i.e. same lines changed, by enabling the Allow content merges
on the repository.
How would I resolve this situation. How I can resolve merge conflict.
The conflicts will be resolved by rebasing the changes on the latest head of the master
branch. For trivial cases this can be done with the rebase button on the UI, otherwise you'll need to do it in your local workspace and manually resolve the conflicts.
Beside that I also want to know about
Abandon this change
button's significance. When we should use this?
A change can be abandoned when it is not needed, or no longer relevant. Then it will not appear in the open changes list. If it is later needed again, it can be restored.
Upvotes: 1