Search in this blog

Tuesday, December 27, 2016

How to resolve a merge conflict?

How to resolve Git merge conflict in workflow using Gerrit?

Example

1. Clone the project Git repository
git clone https://github.com/openstack/python-ironicclient.git
cd python-ironicclient/

2. Create a new local branch for the issue you are working on
git checkout -b bug/1566329

3. Cherry-pick your patch set from Gerrit
git fetch https://git.openstack.org/openstack/python-ironicclient refs/changes/92/365692/11 && git cherry-pick FETCH_HEAD

4. Check git status to see where conflict is
git status

5. Resolve merge conflict using merge tool, IDE or text editor

6. Add changes to the next commit
git add ironicclient/tests/functional/osc/v1/base.py

7. Continue cherry-pick operation
git cherry-pick --continue

8. Push it back to Gerrit
git review

No comments:

Post a Comment