git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git subcommand to check if branch is up-to-date with upstream

From
Sidhant Sharma <tigerkid001@gmail.com>
Date
Jul 26, 2016, 09:32 UTC
Message-ID
<57972E10.4020403@gmail.com>
In-Reply-To
<57964D7F.90402@gmail.com>
On Monday 25 July 2016 11:03 PM, Jakub Narębski wrote:
Show 20 quoted lines
> 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)
>
Nice, didn't know that one. Thanks for the tip.

Regards, Sidhant Sharma

Previous: Jakub Narębski
Message 4 of 4 in “[RFC] git subcommand to check if branch is up-to-date with upstream”
  1. Sidhant SharmaJul 25, 2016
  2. Junio C HamanoJul 25, 2016
  3. Jakub NarębskiJul 25, 2016
  4. Sidhant SharmaJul 26, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.