From: Clemens Buchacher <drizzd@aon.at>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>,
"Daniel Barkalow" <barkalow@iabervon.org>,
"Thomas Rast" <trast@student.ethz.ch>,
git@vger.kernel.org
Subject: [PATCH] modernize fetch/merge/pull examples
Date: Wed, 21 Oct 2009 19:21:23 +0200 [thread overview]
Message-ID: <20091021172123.GB27495@localhost> (raw)
In-Reply-To: <7vk4ypb71j.fsf@alter.siamese.dyndns.org>
The "git pull" documentation has examples which follow an outdated
style. Update the examples to use "git merge" where appropriate and
move the examples to the corresponding manpages.
Furthermore,
o show that pull is equivalent to fetch and merge, which is still a
frequently asked question,
o explain the default fetch refspec.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
On Tue, Oct 20, 2009 at 11:22:16PM -0700, Junio C Hamano wrote:
> For example, I am in favor of deprecating the "pull $there $src:$dst"
> notation.
A first step in that direction.
Clemens
Documentation/git-fetch.txt | 29 +++++++++++++++++++++++++
Documentation/git-merge.txt | 33 +++++++++++++++++++++++++++++
Documentation/git-pull.txt | 49 +++---------------------------------------
3 files changed, 66 insertions(+), 45 deletions(-)
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index d3164c5..c76077d 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -37,6 +37,35 @@ include::pull-fetch-param.txt[]
include::urls-remotes.txt[]
+
+EXAMPLES
+--------
+
+* Update the remote-tracking branches:
++
+------------------------------------------------
+$ git fetch origin
+------------------------------------------------
++
+The above command copies all branches from the remote refs/heads/
+namespace and stores them to the local refs/remotes/origin/ namespace,
+unless the branch.<name>.fetch option is used to specify a non-default
+refspec.
+
+* Using refspecs explicitly:
++
+------------------------------------------------
+$ git fetch origin +pu:pu maint:tmp
+------------------------------------------------
++
+This updates (or creates, as necessary) branches `pu` and `tmp` in
+the local repository by fetching from the branches (respectively)
+`pu` and `maint` from the remote repository.
++
+The `pu` branch will be updated even if it is does not fast-forward;
+the others will not be.
+
+
SEE ALSO
--------
linkgit:git-pull[1]
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index d05f324..2a41d62 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -212,6 +212,39 @@ You can work through the conflict with a number of tools:
common ancestor, 'git show :2:filename' shows the HEAD
version and 'git show :3:filename' shows the remote version.
+
+EXAMPLES
+--------
+
+* Bundle branches `fixes` and `enhancements` on top of
+ the current branch, making an Octopus merge:
++
+------------------------------------------------
+$ git merge fixes enhancements
+------------------------------------------------
+
+* Merge branch `obsolete` into the current branch, using `ours`
+ merge strategy:
++
+------------------------------------------------
+$ git merge -s ours obsolete
+------------------------------------------------
+
+* Merge branch `maint` into the current branch, but do not make
+ a commit automatically:
++
+------------------------------------------------
+$ git merge --no-commit maint
+------------------------------------------------
++
+This can be used when you want to include further changes to the
+merge, or want to write your own merge commit message.
++
+You should refrain from abusing this option to sneak substantial
+changes into a merge commit. Small fixups like bumping
+release/version name would be acceptable.
+
+
SEE ALSO
--------
linkgit:git-fmt-merge-msg[1], linkgit:git-pull[1],
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 7578623..de2bcd6 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -131,54 +131,13 @@ $ git pull origin next
------------------------------------------------
+
This leaves a copy of `next` temporarily in FETCH_HEAD, but
-does not update any remote-tracking branches.
-
-* Bundle local branch `fixes` and `enhancements` on top of
- the current branch, making an Octopus merge:
-+
-------------------------------------------------
-$ git pull . fixes enhancements
-------------------------------------------------
-+
-This `git pull .` syntax is equivalent to `git merge`.
-
-* Merge local branch `obsolete` into the current branch, using `ours`
- merge strategy:
-+
-------------------------------------------------
-$ git pull -s ours . obsolete
-------------------------------------------------
-
-* Merge local branch `maint` into the current branch, but do not make
- a commit automatically:
+does not update any remote-tracking branches. Using remote-tracking
+branches, the same can be done by invoking fetch and merge:
+
------------------------------------------------
-$ git pull --no-commit . maint
+$ git fetch origin
+$ git merge origin/next
------------------------------------------------
-+
-This can be used when you want to include further changes to the
-merge, or want to write your own merge commit message.
-+
-You should refrain from abusing this option to sneak substantial
-changes into a merge commit. Small fixups like bumping
-release/version name would be acceptable.
-
-* Command line pull of multiple branches from one repository:
-+
-------------------------------------------------
-$ git checkout master
-$ git fetch origin +pu:pu maint:tmp
-$ git pull . tmp
-------------------------------------------------
-+
-This updates (or creates, as necessary) branches `pu` and `tmp` in
-the local repository by fetching from the branches (respectively)
-`pu` and `maint` from the remote repository.
-+
-The `pu` branch will be updated even if it is does not fast-forward;
-the others will not be.
-+
-The final command then merges the newly fetched `tmp` into master.
If you tried a pull which resulted in a complex conflicts and
--
1.6.5.1
next prev parent reply other threads:[~2009-10-21 17:21 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 17:47 [RFC] pull/fetch rename Thomas Rast
2009-10-20 19:59 ` Wesley J. Landaker
2009-10-20 21:46 ` Junio C Hamano
2009-10-20 22:53 ` Thomas Rast
2009-10-20 23:11 ` Junio C Hamano
2009-10-21 2:01 ` Wesley J. Landaker
2009-10-20 23:16 ` Junio C Hamano
2009-10-20 21:42 ` Nanako Shiraishi
2009-10-20 22:41 ` Thomas Rast
2009-10-20 23:56 ` Daniel Barkalow
2009-10-21 3:06 ` Björn Steinbrink
2009-10-21 4:22 ` Daniel Barkalow
2009-10-21 11:57 ` Björn Steinbrink
2009-10-21 17:12 ` Daniel Barkalow
2009-10-21 6:22 ` Junio C Hamano
2009-10-21 17:19 ` Clemens Buchacher
2009-10-21 17:21 ` Clemens Buchacher [this message]
2009-10-21 21:38 ` [PATCH] modernize fetch/merge/pull examples Junio C Hamano
2009-10-21 21:41 ` [RFC/PATCH] git-merge: forbid fast-forward and up-to-date when --no-commit is given Junio C Hamano
2009-10-22 10:21 ` Nanako Shiraishi
2009-10-22 22:26 ` Junio C Hamano
2009-10-21 21:46 ` [PATCH] git-merge: imply --no-ff " Junio C Hamano
2009-10-22 6:35 ` Clemens Buchacher
2009-10-22 8:51 ` [PATCH] modernize fetch/merge/pull examples Thomas Rast
2009-10-22 9:48 ` [RFC] pull/fetch rename Thomas Rast
2009-10-21 6:30 ` Mike Hommey
2009-10-21 6:33 ` Junio C Hamano
2009-10-21 7:06 ` Mike Hommey
2009-10-21 7:22 ` Junio C Hamano
2009-10-21 7:45 ` Jeff King
2009-10-21 7:47 ` Jeff King
2009-10-24 6:30 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091021172123.GB27495@localhost \
--to=drizzd@aon.at \
--cc=B.Steinbrink@gmx.de \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).