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

3 messages, 3 authors, 2016-07-26 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-07-25 16:58:59

Sidhant Sharma [off-list ref] 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.

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

From: Jakub Narębski <hidden>
Date: 2016-07-25 17:34:11

W dniu 2016-07-25 o 18:58, Junio C Hamano pisze:
Sidhant Sharma [off-list ref] writes:
quoted
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

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

From: Sidhant Sharma <hidden>
Date: 2016-07-26 09:32:10

On Monday 25 July 2016 11:03 PM, Jakub Narębski wrote:
W dniu 2016-07-25 o 18:58, Junio C Hamano pisze:
quoted
Sidhant Sharma [off-list ref] writes:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help