All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jakub Narębski" <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Sidhant Sharma <tigerkid001@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC] git subcommand to check if branch is up-to-date with upstream
Date: Mon, 25 Jul 2016 19:33:51 +0200	[thread overview]
Message-ID: <57964D7F.90402@gmail.com> (raw)
In-Reply-To: <xmqqd1m17iyb.fsf@gitster.mtv.corp.google.com>

W dniu 2016-07-25 o 18:58, Junio C Hamano pisze:
> Sidhant Sharma <tigerkid001@gmail.com> writes:
> 
>> I was wondering if it would be a good idea to have a command to check if a
>> push or pull is required. Perhaps it can also suggest if changes are
>> fast-forward or the branches (local and remote) have diverged.
> 
> Doesn't "branch -v" give that information these days?  You'd need to
> "fetch" first to get the up-to-date worldview before running it, of
> course.

You need "branch -v -v". For current branch, you can simply run "git checkout".
All this is the information for end user, not scripts.

$ git branch -v -v
* gitweb-docs   4ebf58d [origin/master: ahead 1] gitweb(1): Document query parameters
  master        08bb350 [origin/master] Sixth batch of topics for 2.10

$ git checkout
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

-- 
Jakub Narębski


  reply	other threads:[~2016-07-25 17:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 12:58 [RFC] git subcommand to check if branch is up-to-date with upstream Sidhant Sharma
2016-07-25 16:58 ` Junio C Hamano
2016-07-25 17:33   ` Jakub Narębski [this message]
2016-07-26  9:32     ` Sidhant Sharma

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=57964D7F.90402@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tigerkid001@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.