{"thread":{"id":"51208","subject":"RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"","startedAt":"2019-05-31T14:45:09Z","lastAt":"2019-06-03T21:43:38Z","messageCount":7,"participants":["Cliff Schomburg","Patryk Obara","Denton Liu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"376477","messageId":"BN8PR21MB1156F7F3E7EFF9C8A60F33D0B7190@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51208","inReplyTo":"BN8PR21MB1156DA1893F64814F1BE8709B7180@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-05-31T14:45:05Z","receivedAt":"2019-05-31T14:45:09Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Resending as plain text\n\nFrom: Cliff Schomburg \nSent: Thursday, May 30, 2019 6:29 PM\nTo: git@vger.kernel.org\nSubject: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n\nHi all,\n\nThis is more of a suggestion than a bug report.\n\nI create new topic branches quite frequently and push them into the remote repo (origin).\n\nIt's a bit of a hassle to type \"git push -set-upstream origin newBranchName\" each and every time I want to push a new branch.\n\nI'm proposing a shortcut for this command.  Perhaps \"git push -default\" or \"git push -new-branch\" which could be shortened to \"git push -d\" or \"git push -nb\" or something.\n\nBased on the man-page for push, it looks like this could be an alias for:\n    \"git push -set-upstream origin HEAD\"\nIn which case HEAD should always be the current branch name.\n\nThoughts?  Concerns?\n\nThanks,\nCliff\n\n"},{"id":"376478","messageId":"ac62f96f-0ebc-2dff-3365-781e6b9142a3@gmail.com","threadId":"51208","inReplyTo":"BN8PR21MB1156F7F3E7EFF9C8A60F33D0B7190@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Patryk Obara","fromEmail":"dreamer.tan@gmail.com","sentAt":"2019-05-31T14:51:06Z","receivedAt":"2019-05-31T14:51:12Z","isPatch":false,"sender":{"key":"dreamer.tan@gmail.com","avatar":"https://gravatar.com/avatar/02a74855b64d0dcc954a6d40779626ceccb682459daccef9f688d1f67b230ea4?d=mp&s=160"},"body":"On 31/05/2019 16:45, Cliff Schomburg wrote:\n> I'm proposing a shortcut for this command.\n\nWhat's wrong with \"$ git push -u origin branch\"?\n\n--\nPatryk Obara\n"},{"id":"376479","messageId":"BN8PR21MB115693C381F65E97AB65FA18B7190@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51208","inReplyTo":"ac62f96f-0ebc-2dff-3365-781e6b9142a3@gmail.com","subject":"RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-05-31T14:56:12Z","receivedAt":"2019-05-31T14:56:18Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Wow, I did not see that in the man pages... but I see it now.  Thanks!\n\nSo I guess I would change my ask to this:\n\n\"git push -u\"\n\nShould default to \"origin branch\" if no parameters are provided.  Thoughts?\n\nThanks,\nCliff\n\n-----Original Message-----\nFrom: Patryk Obara <dreamer.tan@gmail.com> \nSent: Friday, May 31, 2019 10:51 AM\nTo: Cliff Schomburg <clisc@microsoft.com>; git@vger.kernel.org\nSubject: Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n\nOn 31/05/2019 16:45, Cliff Schomburg wrote:\n> I'm proposing a shortcut for this command.\n\nWhat's wrong with \"$ git push -u origin branch\"?\n\n--\nPatryk Obara\n"},{"id":"376480","messageId":"ebc03b4e-daf8-d47f-94ca-a4a549589773@gmail.com","threadId":"51208","inReplyTo":"BN8PR21MB115693C381F65E97AB65FA18B7190@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Patryk Obara","fromEmail":"dreamer.tan@gmail.com","sentAt":"2019-05-31T15:05:24Z","receivedAt":"2019-05-31T15:05:29Z","isPatch":false,"sender":{"key":"dreamer.tan@gmail.com","avatar":"https://gravatar.com/avatar/02a74855b64d0dcc954a6d40779626ceccb682459daccef9f688d1f67b230ea4?d=mp&s=160"},"body":"On 31/05/2019 16:56, Cliff Schomburg wrote:\n> Wow, I did not see that in the man pages... but I see it now.  Thanks!\n> \n> So I guess I would change my ask to this:\n> \n> \"git push -u\"\n> \n> Should default to \"origin branch\" if no parameters are provided.\n\nI think most people will agree, considering it already works this way :)\n\nThe default behaviour of git push changed in Git 2.0, perhaps you were \nreading some old tutorial. You can configure it to match your \npreferences by changing push.default value in your git config:\n\nhttps://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault\n\n--\nPatryk Obara\n"},{"id":"376481","messageId":"20190531151126.GA3465@archbookpro.localdomain","threadId":"51208","inReplyTo":"BN8PR21MB115693C381F65E97AB65FA18B7190@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-05-31T15:11:26Z","receivedAt":"2019-05-31T15:11:31Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"On Fri, May 31, 2019 at 02:56:12PM +0000, Cliff Schomburg wrote:\n> Wow, I did not see that in the man pages... but I see it now.  Thanks!\n> \n> So I guess I would change my ask to this:\n> \n> \"git push -u\"\n> \n> Should default to \"origin branch\" if no parameters are provided.  Thoughts?\n\nI'll do you one better. You can run\n\n\t$ git push -u origin HEAD\n\nand HEAD will mean the current branch, so you'll only need to specify\nthe remote (in our case, origin).\n\nPerhaps you could alias that to something like `git push-up`.\n\n> \n> Thanks,\n> Cliff\n> \n> -----Original Message-----\n> From: Patryk Obara <dreamer.tan@gmail.com> \n> Sent: Friday, May 31, 2019 10:51 AM\n> To: Cliff Schomburg <clisc@microsoft.com>; git@vger.kernel.org\n> Subject: Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n> \n> On 31/05/2019 16:45, Cliff Schomburg wrote:\n> > I'm proposing a shortcut for this command.\n> \n> What's wrong with \"$ git push -u origin branch\"?\n> \n> --\n> Patryk Obara\n"},{"id":"376482","messageId":"BN8PR21MB1156D785177A40EA7D8341ABB7190@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51208","inReplyTo":"ebc03b4e-daf8-d47f-94ca-a4a549589773@gmail.com","subject":"RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-05-31T15:13:21Z","receivedAt":"2019-05-31T15:13:25Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Thanks, Patryk.  It's always nice to see the feature I want is already implemented!  😊\n\n-----Original Message-----\nFrom: Patryk Obara <dreamer.tan@gmail.com> \nSent: Friday, May 31, 2019 11:05 AM\nTo: Cliff Schomburg <clisc@microsoft.com>; git@vger.kernel.org\nSubject: Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n\nOn 31/05/2019 16:56, Cliff Schomburg wrote:\n> Wow, I did not see that in the man pages... but I see it now.  Thanks!\n> \n> So I guess I would change my ask to this:\n> \n> \"git push -u\"\n> \n> Should default to \"origin branch\" if no parameters are provided.\n\nI think most people will agree, considering it already works this way :)\n\nThe default behaviour of git push changed in Git 2.0, perhaps you were reading some old tutorial. You can configure it to match your preferences by changing push.default value in your git config:\n\nhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-config%23Documentation%2Fgit-config.txt-pushdefault&amp;data=02%7C01%7Cclisc%40microsoft.com%7Cf52d699c3fc149d20de508d6e5d96a4c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636949119289770838&amp;sdata=K2NezwOWzZrqsU7l8GybjbJuwmRnC2llT77UhvF%2B8RU%3D&amp;reserved=0\n\n--\nPatryk Obara\n"},{"id":"376614","messageId":"BN8PR21MB11569B2A49F0ACB69E883458B7140@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51208","inReplyTo":"BN8PR21MB1156D785177A40EA7D8341ABB7190@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-06-03T21:34:26Z","receivedAt":"2019-06-03T21:43:38Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"So I gave this a try and it seems not to be behaving as expected:\n\n>git push -u\nfatal: The current branch {branchName} has no upstream branch.\nTo push the current branch and set the remote as upstream, use\n\n    git push --set-upstream origin {branchName}\n\nI'm using Git for Windows in a Windows CMD prompt, if that matters at all.\n\nThanks,m\nCliff\n\n\n-----Original Message-----\nFrom: Cliff Schomburg \nSent: Friday, May 31, 2019 11:13 AM\nTo: Patryk Obara <dreamer.tan@gmail.com>; git@vger.kernel.org\nSubject: RE: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n\nThanks, Patryk.  It's always nice to see the feature I want is already implemented!  😊\n\n-----Original Message-----\nFrom: Patryk Obara <dreamer.tan@gmail.com> \nSent: Friday, May 31, 2019 11:05 AM\nTo: Cliff Schomburg <clisc@microsoft.com>; git@vger.kernel.org\nSubject: Re: Simple shortcut for \"git push --set-upstream origin newBranchName\"\n\nOn 31/05/2019 16:56, Cliff Schomburg wrote:\n> Wow, I did not see that in the man pages... but I see it now.  Thanks!\n> \n> So I guess I would change my ask to this:\n> \n> \"git push -u\"\n> \n> Should default to \"origin branch\" if no parameters are provided.\n\nI think most people will agree, considering it already works this way :)\n\nThe default behaviour of git push changed in Git 2.0, perhaps you were reading some old tutorial. You can configure it to match your preferences by changing push.default value in your git config:\n\nhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-config%23Documentation%2Fgit-config.txt-pushdefault&amp;data=02%7C01%7Cclisc%40microsoft.com%7Cf52d699c3fc149d20de508d6e5d96a4c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636949119289770838&amp;sdata=K2NezwOWzZrqsU7l8GybjbJuwmRnC2llT77UhvF%2B8RU%3D&amp;reserved=0\n\n--\nPatryk Obara\n"}]}