How to stay synchronized on GitHub after fork (Windows environment)

Source: Internet
Author: User

We're going to fork someone else's project, which creates a copy of the project on GitHub that doesn't affect the original author, and can clone the project on GitHub to a local change, modify it, and push it, and only the project on GitHub will be changed. The original author project will not be affected, avoid the original author project is contaminated. But if the original author is constantly updating his project, how to make his own github on the same sync? Here's a tool for installing GitHub in Windows, a git Shell that has never known its usefulness, this time.


1) go to the Local project directory and enter Git remote-v:




The URL inside the basket is the item on my github, and the URL in the red box is the original author item. If there is no upstream, i.e. no URL for the original author project, you need to add it yourself: Git remote add upstream < original author Project url>


2) Synchronize the contents of the original Author project update to my local project (not my GitHub online project):


A) Fetch the branches and their respective commits from the upstream repository. Commits tomaster would be stored in a local branch, Upstream/master.



b) Check out your fork ' s local masterbranch.



c) The next step is to merge the two branches, synchronizing the changes of the original author's project to your own (note or local project, not the project in your own GitHub space). Merge the changes fromupstream/master to your local master branch. This brings your fork ' s Master branch to sync with the upstream repository, without losing your local changes.



My local project is now synchronized with the original author project.


3) also keep your GitHub space projects in sync:

Push a local project's modifications (that is, content synchronized with the original author project) to your GitHub with another tool Github.exe




How to stay synchronized after a fork on GitHub (Windows environment)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.