public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* a more helpful message on "git status" output
@ 2014-07-18 19:03 Julián Landerreche
  2014-07-18 19:29 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Julián Landerreche @ 2014-07-18 19:03 UTC (permalink / raw)
  To: git

Hi,
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.
So...

Proposal: suggesting the user to run "git merge" or "git merge
origin/master" seems a more helpful suggestion, imo. Also, for
beginners, it helps for better understanding on what's going on, and
goes in hand with the usual advice of using "git fetch" + "git merge"
(instead of "git pull") to grasp better some Git concepts and how Git
works.
So, the output of git status would read like this:

  On branch master
  Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.
    (use "git merge origin/master" to update your local branch)

(it could read "git merge" too, if it defaults to merging upstream,
tracked branch).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-21 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 19:03 a more helpful message on "git status" output Julián Landerreche
2014-07-18 19:29 ` Junio C Hamano
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox