2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-21 19:22:05 +00:00

Chnage how to use pull request in doc:

How to add more change for a pull request
  How to resolve conflict for a pull request
This commit is contained in:
wangxiaopeng 2015-09-21 10:47:30 -04:00
parent 48e1924501
commit cbaa8b8ae2

View File

@ -16,6 +16,56 @@ Once your changes are ready to be submitted to the xcat team, the easiest way to
#. Submit the pull request!
Changing Pull Request
---------------------
After submitting a pull request, you may get comments from reviewer that something needs to be changed. Then you can use following steps to change your pull request.
#. Change any code and add them to be tracked in git ::
$git checkout <mybranch>
$vi <files>
$git add <files>
#. Commit the change to last commit in the branch instead of creating a new commit. This step is useful to keep the change of this pull request in one commit instead of multiple ones. ::
$git commit --amend
#. Push the new commit to remote repository. Then the commit will be displayed in pull request automatically. ::
$git push origin <mybranch>
Resolving Conflit in the Pull Request
------------------------------------
During the reviewing of your pull request, some one may change certain code which conflict with your change so that your pull request can NOT be merged automatically. You can use following steps to resolve the conflict.
#. Update the upstream ::
$git fetch <upstream>
#. Checkout to your working branch ::
$git checkout <mybranch>
#. rebase your branch to the master branch in the <upstream> ::
$git rebase <upstream>/master
#. In the previous step, you should see there are some conflicts in certain files. Edit the files to resolve the conflicts manually and add the files to be tracked in git. ::
$vi <files>
$git add <files>
#. Continue the rebase ::
$git rebase --continue
#. Push the change to the remote repository ::
$git push origin <mybranch>
Then you will see the pull request is enabled to be merged automatically.
Reviewing Pull Requests as a Maintainer
---------------------------------------