Difference Between Git Commands vs GitHub Desktop to Review Pull Requests #2618
Unanswered
JessicaLucindaCheng
asked this question in
General
Replies: 1 comment 1 reply
-
Thanks Jessica for starting this discussion. Is there a command in GitHub Desktop to make sure recent updates are incorporated as well (refering to the last line in your post)? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Note: I am deleting branch update-project-profile-design-systems-2419 associated with pull request 2556 because it has already been merged into the repo. Thus, it won't be possible to test/try out the examples below.
Pull request 2556 Updated design systems' project profile with current project team as will be used as an example. An example of a page that is different when using git commands vs GitHub Desktop is localhost:4000/projects/design-systems. You'll notice the links, languages, and technologies look different. Also, I am assuming I have fetched and merged the most recent updates from the Hack for LA repo into my forked gh-pages repo before doing any of the following.
Git Commands
When I use git commands, the following happens:
git checkout -b JessicaLucindaCheng-update-project-profile-design-systems-2419 gh-pages
A new branch named "JessicaLucindaCheng-update-project-profile-design-systems-2419" is created based on my forked gh-pages, which is up to date with the Hack for LA repo. That command also switched into the new branch JessicaLucindaCheng-update-project-profile-design-systems-2419 that was created. [1]
git pull https://github.com/JessicaLucindaCheng/website.git update-project-profile-design-systems-2419
This fetches content from the update-project-profile-design-systems-2419 branch in JessicaLucindaCheng's forked repo and merges that content into my new branch JessicaLucindaCheng-update-project-profile-design-systems-2419. [2, 3]
Since the JessicaLucindaCheng-update-project-profile-design-systems-2419 was based on my branch (gh-pages) with the most recent Hack for LA repo updates, the changes JessicaLucindaCheng made along with the most recent updates are seen together. This occurs even if JessicaLucindaCheng did not incorporate the most recent changes into her branch.
GitHub Desktop
Using GitHub Desktop to review pull requests is similar to using the following git commands
git fetch upstream pull/2556/head:mytestingpr
where upstream is the gh-pages from the Hack for LA repo, 2556 is the pull request number, and "mytestingpr" is the name of a new branch being created. Based on the PR number 2556, this line of code fetches the contents of the branch update-project-profile-design-systems-2419 from JessicaLucindaChengs's forked repo and merges it into the empty mytestingpr branch. [4]
git checkout mytestingpr
This switches into the mytestingpr branch. The contents of the mytestingpr branch are exactly same as the one in JessicaLucindaCheng's forked repo branch update-project-profile-design-systems-2419. This may not contain the most recent updates depending on if JessicaLucindaCheng included the updates in her branch and depending on when I am reviewing/pulling the pull request, such as if it has been a few days since the pull request was created. [4]
References
[1] New Branches section of https://www.atlassian.com/git/tutorials/using-branches/git-checkout
[2] Git Pull on Remotes section of https://www.atlassian.com/git/tutorials/syncing/git-pull
[3] https://stackoverflow.com/questions/1709177/git-pull-a-certain-branch-from-github
[4] Steps 5 and 6 of https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Beta Was this translation helpful? Give feedback.
All reactions