a more helpful message on "git status" output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]