简体   繁体   中英

how to update locally cloned git repo with changes from the original project (no fork!)

I am a bit new to git so I may misuse git terminology in the following... Searching for a an answer I only found cases, where a fork (that is: another repo on github or similiar) was created - which I don't want (yet). Or it least: This is the way I think I understood it....

What I want is: To clone a github repo of a project located on github onto my harddisk (already done). Makeing changes to that cloned repo and don't put those online (because they are highly experimental in this moment). And I want to be able to update my cloned repo with changes made to the mother/father original repo on github without overwriting my changes (by risking conflicts from time to time...).

Is this possible and how can I accomplish this?

There is no significant difference if you use a fork (different remote ) or the original repository ( origin ) while synchronizing the remote changes to your local branch. What you are trying to achieve is a common git workflow routine and you can get it either by git pull command or git pull --rebase . The final outcome will be the same from your perspective - you will keep your local changes (commits) and you will be up-to-date with the remote changes at the same time. However, the history log can be slightly different. See the question if you want to dive into the details.

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