]> git.phdru.name Git - git-wiki.git/commitdiff
Add more details about fetch/pull/push
authorOleg Broytman <phd@phdru.name>
Fri, 26 Jun 2015 23:26:59 +0000 (02:26 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 26 Jun 2015 23:31:20 +0000 (02:31 +0300)
pep-git.txt

index 3158a4a8d6f066ff078c9532aafbf96029d354db..8f5d8f27ddea54b061ac9ccb60189c09468080d2 100644 (file)
@@ -200,8 +200,8 @@ and
 
 The first command fetches commits from the named BRANCH in the REMOTE
 repository that are not in your repository and leaves the id (the
 
 The first command fetches commits from the named BRANCH in the REMOTE
 repository that are not in your repository and leaves the id (the
-hash) of the head commit in file .git/FETCH_HEAD. But it doesn't
-update any branch (doesn't move any pointer).
+hash) of the head commit in file .git/FETCH_HEAD and
+updates remote-tracking branch.
 
 The second command fetches commits from the named BRANCH in the REMOTE
 repository that are not in your repository and updates both the local
 
 The second command fetches commits from the named BRANCH in the REMOTE
 repository that are not in your repository and updates both the local
@@ -258,6 +258,10 @@ or even
 
     $ git pull
 
 
     $ git pull
 
+Default remote repository for fetching/pulling is origin. Default set
+of references to fetch is calculated using matching algorithm: git
+fetches all branches having the same name on both ends.
+
 Push
 ''''
 
 Push
 ''''
 
@@ -268,9 +272,8 @@ run
 
     $ git push origin v1 v2
 
 
     $ git push origin v1 v2
 
-git guesses (knowing upstream remote branches) that you really want
-
-::
+git pushes local v1 to remote v1 and local v2 to remote v2. The same
+as::
 
     $ git push origin v1:v1 v2:v2
 
 
     $ git push origin v1:v1 v2:v2
 
@@ -297,6 +300,21 @@ or even
 
     $ git push
 
 
     $ git push
 
+Default remote repository for pushing is origin. Default set
+of references to push in git before 2.0 is calculated using matching
+algorithm: git pushes all branches having the same name on both ends.
+Default set of references to push in git 2.0+ is calculated using
+simple algorithm: git pushes the current branch back to its
+@{upstream}.
+
+To configure git before 2.0 to the new behaviour run::
+
+$ git config push.default simple
+
+To configure git 2.0+ to the old behaviour run::
+
+$ git config push.default matching
+
 Git refuses to push a branch if it's the current branch in the remote
 non-bare repository: git refuses to update remote working directory.
 You really should push only to bare repositories. For non-bare
 Git refuses to push a branch if it's the current branch in the remote
 non-bare repository: git refuses to update remote working directory.
 You really should push only to bare repositories. For non-bare