简体   繁体   中英

How can I retrieve a commit made on github to my local repo?

On one of my pull request, I clicked the 'update branch' button. Now this made a new merge master to branch commit on github and not on local. How can I get that commit from my PR so that I can squash it?

From the command line, you can use git pull to get any changes made in another repository. There are GUI tools to do the same thing, but I'm not familiar with many of them. If you are developing in an IDE, it will have either built-in support for this and many other git commands or a plugin which you can install.

To get the commits from the pull request, you will first need to use git remote add to add the other repository as a remote. Then you can use git pull to pull any commits from the other repository.

I have purposely left out the details for how these commands work. I suggest you use git help to learn more about these commands. The help pages are a very valuable resource which you should familiarize yourself with.

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