{"thread":{"id":"42919","subject":"[RFC] git subcommand to check if branch is up-to-date with upstream","startedAt":"2016-07-25T12:58:47Z","lastAt":"2016-07-26T09:32:10Z","messageCount":4,"participants":["Sidhant Sharma","Junio C Hamano","Jakub Narębski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"292091","messageId":"57960CFF.5060104@gmail.com","threadId":"42919","inReplyTo":null,"subject":"[RFC] git subcommand to check if branch is up-to-date with upstream","fromName":"Sidhant Sharma","fromEmail":"tigerkid001@gmail.com","sentAt":"2016-07-25T12:58:39Z","receivedAt":"2016-07-25T12:58:47Z","isPatch":false,"sender":{"key":"tigerkid001@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7801881?v=4"},"body":"Hi,\nI was wondering if it would be a good idea to have a command to check if a\npush or pull is required. Perhaps it can also suggest if changes are\nfast-forward or the branches (local and remote) have diverged.\nThe reason I feel the need of such a command is when I need to check if my\nbranch is up-to-date with the remote, and when I need to know if my local\nhas diverged. Currently I use a script based on this stackoverflow answer[1]\nNot an extremely useful tool, but I thought it'll be good to have it.\n\nWarm regards,\nSidhant Sharma\n\n\n[1] http://stackoverflow.com/a/3278427/5211579\n"},{"id":"292105","messageId":"xmqqd1m17iyb.fsf@gitster.mtv.corp.google.com","threadId":"42919","inReplyTo":"57960CFF.5060104@gmail.com","subject":"Re: [RFC] git subcommand to check if branch is up-to-date with upstream","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-25T16:58:52Z","receivedAt":"2016-07-25T16:58:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sidhant Sharma <tigerkid001@gmail.com> writes:\n\n> I was wondering if it would be a good idea to have a command to check if a\n> push or pull is required. Perhaps it can also suggest if changes are\n> fast-forward or the branches (local and remote) have diverged.\n\nDoesn't \"branch -v\" give that information these days?  You'd need to\n\"fetch\" first to get the up-to-date worldview before running it, of\ncourse.\n"},{"id":"292111","messageId":"57964D7F.90402@gmail.com","threadId":"42919","inReplyTo":"xmqqd1m17iyb.fsf@gitster.mtv.corp.google.com","subject":"Re: [RFC] git subcommand to check if branch is up-to-date with upstream","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2016-07-25T17:33:51Z","receivedAt":"2016-07-25T17:34:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 2016-07-25 o 18:58, Junio C Hamano pisze:\n> Sidhant Sharma <tigerkid001@gmail.com> writes:\n> \n>> I was wondering if it would be a good idea to have a command to check if a\n>> push or pull is required. Perhaps it can also suggest if changes are\n>> fast-forward or the branches (local and remote) have diverged.\n> \n> Doesn't \"branch -v\" give that information these days?  You'd need to\n> \"fetch\" first to get the up-to-date worldview before running it, of\n> course.\n\nYou need \"branch -v -v\". For current branch, you can simply run \"git checkout\".\nAll this is the information for end user, not scripts.\n\n$ git branch -v -v\n* gitweb-docs   4ebf58d [origin/master: ahead 1] gitweb(1): Document query parameters\n  master        08bb350 [origin/master] Sixth batch of topics for 2.10\n\n$ git checkout\nYour branch is ahead of 'origin/master' by 1 commit.\n  (use \"git push\" to publish your local commits)\n\n-- \nJakub Narębski\n\n"},{"id":"292186","messageId":"57972E10.4020403@gmail.com","threadId":"42919","inReplyTo":"57964D7F.90402@gmail.com","subject":"Re: [RFC] git subcommand to check if branch is up-to-date with upstream","fromName":"Sidhant Sharma","fromEmail":"tigerkid001@gmail.com","sentAt":"2016-07-26T09:32:00Z","receivedAt":"2016-07-26T09:32:10Z","isPatch":false,"sender":{"key":"tigerkid001@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7801881?v=4"},"body":"On Monday 25 July 2016 11:03 PM, Jakub Narębski wrote:\n> W dniu 2016-07-25 o 18:58, Junio C Hamano pisze:\n>> Sidhant Sharma <tigerkid001@gmail.com> writes:\n>>\n>>> I was wondering if it would be a good idea to have a command to check if a\n>>> push or pull is required. Perhaps it can also suggest if changes are\n>>> fast-forward or the branches (local and remote) have diverged.\n>> Doesn't \"branch -v\" give that information these days?  You'd need to\n>> \"fetch\" first to get the up-to-date worldview before running it, of\n>> course.\n> You need \"branch -v -v\". For current branch, you can simply run \"git checkout\".\n> All this is the information for end user, not scripts.\n>\n> $ git branch -v -v\n> * gitweb-docs   4ebf58d [origin/master: ahead 1] gitweb(1): Document query parameters\n>   master        08bb350 [origin/master] Sixth batch of topics for 2.10\n>\n> $ git checkout\n> Your branch is ahead of 'origin/master' by 1 commit.\n>   (use \"git push\" to publish your local commits)\n>\nNice, didn't know that one. Thanks for the tip.\n\nRegards,\nSidhant Sharma\n"}]}