From: Junio C Hamano <gitster@pobox•com>
To: "Julián Landerreche" <maniqui@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: a more helpful message on "git status" output
Date: Fri, 18 Jul 2014 12:29:11 -0700 [thread overview]
Message-ID: <xmqq38dympo8.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAKQhN+rK0ftwC5hX4hDhXZbcEGAfCCBXRaQXYnMFLmR=n21OLA@mail.gmail.com> ("Julián Landerreche"'s message of "Fri, 18 Jul 2014 16:03:43 -0300")
Julián Landerreche <maniqui@gmail•com> writes:
> when running "git status", if the current branch can be
> fast-forwarded, the user get this message:
>
> On branch master
> Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.
> (use "git pull" to update your local branch)
>
> The suggestion of using "git pull" for updating the local branch,
> although it will work, might not be a proper choice or advice in terms
> of what is really needed to just update the local branch.
>
> As the user already has the newer commits locally (ie. the commits
> have been already "git fetch"ed), he just needs to merge them. Running
> "git pull" will unnecessarily try to fetch commits from upstream
> again.
By running "git pull", the user may obtain yet newer commits from
the upstream, which very likely will happen in an active project, or
"git fetch" launched by "git pull" will return without doing
anything after noticing there is nothing new.
As long as the updates to the upstream is also a fast-forward, it
will still fast-forward you, but to an even newer state of the
upstream.
There is no harm done[*1*] by suggesting "git pull" over "git
merge", no?
[Footnote]
*1* There is a bigger problem with this message, especially when the
user sees it on 'master', but your message is about the case where
you are strictly behind and that bigger problem will not be an
issue, so I won't discuss it further.
next prev parent reply other threads:[~2014-07-18 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 19:03 a more helpful message on "git status" output Julián Landerreche
2014-07-18 19:29 ` Junio C Hamano [this message]
2014-07-18 19:47 ` Julián Landerreche
2014-07-18 21:05 ` Jonathan Nieder
2014-07-18 21:12 ` Junio C Hamano
2014-07-21 10:20 ` Matthieu Moy
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=xmqq38dympo8.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=maniqui@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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