mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	Simplify the steps to update forked repository
This commit is contained in:
		@@ -3,46 +3,40 @@ Syncing a Fork
 | 
			
		||||
 | 
			
		||||
**Note:** *The examples below all reference the master branch*
 | 
			
		||||
 | 
			
		||||
Before the Syncing
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
References: https://help.github.com/articles/syncing-a-fork/
 | 
			
		||||
 | 
			
		||||
From time to time, your master branch will start to fall behind the upstream/master because changes are being pulled into the `xcat2/xcat-core`` project from other developers. 
 | 
			
		||||
From time to time, your master branch will start to **fall behind** the upstream/master because changes are being pulled into the `xcat2/xcat-core`` project from other developers. 
 | 
			
		||||
 | 
			
		||||
.. image:: github-behind_master.png
 | 
			
		||||
 | 
			
		||||
Use the following steps to sync up your forked copy: 
 | 
			
		||||
Update the **master branch** of your forked copy from xcat2/xcat-core
 | 
			
		||||
---------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Fetching commits from upstream to your local
 | 
			
		||||
--------------------------------------------
 | 
			
		||||
#. Pull the ahead commits from the ``upstream master`` to your local master branch. ::
 | 
			
		||||
 | 
			
		||||
#. Fetch the upstream changes for the master branch.  (changed are stored in a local branch: ``upstream/master``) ::
 | 
			
		||||
    $ git pull upstream master
 | 
			
		||||
    remote: Counting objects: 38, done.
 | 
			
		||||
    remote: Compressing objects: 100% (15/15), done.
 | 
			
		||||
    remote: Total 38 (delta 14), reused 9 (delta 9), pack-reused 14
 | 
			
		||||
    Unpacking objects: 100% (38/38), done.
 | 
			
		||||
    From github.com:xcat2/xcat-core
 | 
			
		||||
     * branch            master     -> FETCH_HEAD
 | 
			
		||||
       8f0cb07..d0651b5  master     -> upstream/master
 | 
			
		||||
    Updating 8f0cb07..d0651b5
 | 
			
		||||
    Fast-forward
 | 
			
		||||
    ...
 | 
			
		||||
 | 
			
		||||
      $ git fetch upstream
 | 
			
		||||
      Enter passphrase for key '/home/vhu/.ssh/github/id_rsa': 
 | 
			
		||||
      From github.com:xcat2/xcat-core
 | 
			
		||||
       * [new branch]      master     -> upstream/master
 | 
			
		||||
#. Push the commits from your local master to your forked copy in GitHub: ::
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
#. Switch to your master branch and merge from upstream/master: ::
 | 
			
		||||
    $ git push origin master
 | 
			
		||||
 | 
			
		||||
      $ git checkout master
 | 
			
		||||
      Switched to branch 'master'
 | 
			
		||||
      
 | 
			
		||||
      $ git merge upstream/master
 | 
			
		||||
      Updating a24d02f..f531ff8
 | 
			
		||||
      Fast-forward
 | 
			
		||||
      ...
 | 
			
		||||
     
 | 
			
		||||
Pushing the merged changes from your local to your remote fork
 | 
			
		||||
--------------------------------------------------------------
 | 
			
		||||
After the Syncing
 | 
			
		||||
-----------------
 | 
			
		||||
 | 
			
		||||
The following is needed to push the changes that you merged from upstream into your local clone on your development machine to the remote GitHub repository.
 | 
			
		||||
 | 
			
		||||
#. Sync the changes in your master branch to GitHub: ::
 | 
			
		||||
 | 
			
		||||
      $ git push origin master
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Your fork master branch should now be even with ``xcat2/xcat-core``
 | 
			
		||||
Your fork master branch should now be **even** with ``xcat2/xcat-core``
 | 
			
		||||
 | 
			
		||||
.. image:: github-even_with_master.png 
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user