Fork projects are updated synchronously with remote branches

After forking someone else's project clone to the local, the remote branch is modified, and the remote branch needs to be synchronized to make the local code consistent with the remote branch.

 

1、git remote -v:

 

orgin: for the local branch

upstream: for the remote branch

 

2. git remote add upstream  <URL of the original author's project> ( If there is no upstream in the previous operation, you need to add uptream )

Once done, execute git remote -v to confirm the existence of orgin and upstream.

 

3. git fetch upstream synchronizes the remote branch to the local

4. git checkout master switches the master branch to check local code changes

5. git merge upstream/master merge branch

6. Handle conflicts

Where to manually modify conflict markers

>>>>>>

<<<<<<

7. git add . Add all modified files 

8. git commit -m "merge update" to submit changes

9. git push push to the server

 

Finish

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326931549&siteId=291194637