简体   繁体   中英

Changes after Pull Request

I made a Pull Request for a GitHub project but it was rejected because of some changes which were recommended to me. Now I can see that after my pull request there are others request which are made and merged. My question is what are the exact steps I should do to be sure that my local clone is up to date with all the other stuff going on the real repo. These are the steps I did:

  1. Forked a GitHub project
  2. Cloned it locally
  3. Created a topical branch
  4. Made a few changes
  5. Committed and pushed the changes
  6. Then from GitHub I pressed the Pull Request button and my Pull Request was on the list of requests (so basically everything was successful).

I run git pull origin master inside my branch and it said that everything is up to date. I run git checkout master and did the last step and the output was the same - everything is up to date but I can see that there are other merged request after mine. My suggestion is that this is because I fork the repo.

So reading about syncing a fork with the original repo are the steps described here https://help.github.com/articles/syncing-a-fork/ what I need in this situation?

As the link you mentions describes, you need to add a remote for the original repository, if you want to sync your local master branch and bring it up to date:

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
# and then
git fetch upstream

You can replace upstream with any name you want. After this, follow the steps you would normally take to bring a local branch up to date. If you wanted to do this via merging, you could do:

git checkout master
git merge upstream/master

At this point, your local forked master branch should be up to date with the latest original master , and then warnings in GitHub should have gone away, allowing your reviewer to complete the pull request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM