cmneal26 / Tech-Writing-Project

Class repository
2 stars 1 forks source link

Update The Content Of Your Pull Request With The Latest Changes In 'main' #21

Closed ghost closed 2 years ago

ghost commented 2 years ago

When you originally cloned your repo, you got the current version of the 'main' branch at that time. Then you created a new branch on your machine, and made some changes. Finally, you pushed those changes to GitHub. However, in-between the time when you cloned the original repo, and you opened the pull request on GitHub, Tim updated 'main' by merging in some code.

You can see the status of the branch you want to merge into 'main' says "two commits behind":

branch_status

One thing I've found helpful to avoid problems is if I always make sure the code in the branch the pull request I opened is up to date with main before merging the pull request. This isn't necessarily something you're going to be doing a lot for this course, but I think it's good to know how to do.

So, the goal of this learning issue is to update your pull request with the new content that got added to 'main' by pulling in the changes in the remote 'main' to your machine on the branch you used to open the pull request.

I'll update this ticket in a bit with some more detailed instructions for how to carry out this task.

ghost commented 2 years ago

Instructions For Updating Remote Repo with current 'main' content:

  1. Make sure locally you're on the correct branch: verify_branch

  2. Update 'my-changes' branch with 'main' content, by pulling in remote main content: pull_in_remote_main_changes

  3. Check repo status with 'git status': check_status

  4. push the new changes to my-changes local to my-changes remote on GitHub push_changes_to_GitHub

cmneal26 commented 2 years ago

I see what you mean. Thanks for the instructions! I'm sure that'll be very useful in the future. For now I closed out my PR because I didn't make any changes anyway XD