{"thread":{"id":"44757","subject":"Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","startedAt":"2016-12-22T21:14:57Z","lastAt":"2016-12-27T17:48:23Z","messageCount":5,"participants":["Stefan Monov","Junio C Hamano","Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"308264","messageId":"CAJtFkWtjowyGaFfsCVd-HAZM2-3e0=CkkyYfxne8KRdYq5kJ9g@mail.gmail.com","threadId":"44757","inReplyTo":null,"subject":"Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","fromName":"Stefan Monov","fromEmail":"logixoul@gmail.com","sentAt":"2016-12-22T21:14:31Z","receivedAt":"2016-12-22T21:14:57Z","isPatch":false,"sender":{"key":"logixoul@gmail.com","avatar":"https://gravatar.com/avatar/225c01274d1ead9f204fb7d8b871a9aad653bd3d80dd4356efc8c83fdbc750e4?d=mp&s=160"},"body":"Hi.\n\nI'd like to use just:\n\n    git push\n\nor at most:\n\n    git push origin\n\nrather than having to first check which is the active branch with `git\nbranch --list`, then type:\n\n    git push origin <branch>\n\nAt [1] and [2] I've seen that if I do this once:\n\n    git push -u origin <branch>\n\nthen from then on I can use just `git push` _for that branch_.\nHowever, I don't want to do this \"setup\" step for each branch, because\nit's extra work that I also may forget to do.\n\nWhy is this \"setup\" step necessary and can I avoid it?\n\nThanks,\nStefan\n\n[1] http://stackoverflow.com/q/19312622\n[2] http://stackoverflow.com/q/6529136\n"},{"id":"308265","messageId":"CAJtFkWuypdH+ikdXL=-DXOx-8F+34nV3phqO2jTGoqtnM7=DZA@mail.gmail.com","threadId":"44757","inReplyTo":"CAJtFkWtjowyGaFfsCVd-HAZM2-3e0=CkkyYfxne8KRdYq5kJ9g@mail.gmail.com","subject":"Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","fromName":"Stefan Monov","fromEmail":"logixoul@gmail.com","sentAt":"2016-12-22T21:18:38Z","receivedAt":"2016-12-22T21:19:15Z","isPatch":false,"sender":{"key":"logixoul@gmail.com","avatar":"https://gravatar.com/avatar/225c01274d1ead9f204fb7d8b871a9aad653bd3d80dd4356efc8c83fdbc750e4?d=mp&s=160"},"body":"Also, if I do the \"setup\" step (`push -u`) for a branch that doesn't\nexist yet (neither on my PC nor on the server), does that remove the\nneed to do `git checkout -b <branch>` first?\n\nOn Thu, Dec 22, 2016 at 11:14 PM, Stefan Monov <logixoul@gmail.com> wrote:\n> Hi.\n>\n> I'd like to use just:\n>\n>     git push\n>\n> or at most:\n>\n>     git push origin\n>\n> rather than having to first check which is the active branch with `git\n> branch --list`, then type:\n>\n>     git push origin <branch>\n>\n> At [1] and [2] I've seen that if I do this once:\n>\n>     git push -u origin <branch>\n>\n> then from then on I can use just `git push` _for that branch_.\n> However, I don't want to do this \"setup\" step for each branch, because\n> it's extra work that I also may forget to do.\n>\n> Why is this \"setup\" step necessary and can I avoid it?\n>\n> Thanks,\n> Stefan\n>\n> [1] http://stackoverflow.com/q/19312622\n> [2] http://stackoverflow.com/q/6529136\n"},{"id":"308271","messageId":"xmqq7f6rfxpe.fsf@gitster.mtv.corp.google.com","threadId":"44757","inReplyTo":"CAJtFkWtjowyGaFfsCVd-HAZM2-3e0=CkkyYfxne8KRdYq5kJ9g@mail.gmail.com","subject":"Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-22T21:41:49Z","receivedAt":"2016-12-22T21:42:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Monov <logixoul@gmail.com> writes:\n\n> I'd like to use just:\n>\n>     git push\n>\n> or at most:\n>\n>     git push origin\n>\n> rather than having to first check which is the active branch with `git\n> branch --list`, then type:\n>\n>     git push origin <branch>\n\nPerhaps you are a target audience of\n\n    $ git config push.default current\n\nthen?\n"},{"id":"308273","messageId":"CA+P7+xpdKEoNY_cgY4g3bMVZe0p-2bYT4Y-3nYyd0O03iD1nZg@mail.gmail.com","threadId":"44757","inReplyTo":"CAJtFkWtjowyGaFfsCVd-HAZM2-3e0=CkkyYfxne8KRdYq5kJ9g@mail.gmail.com","subject":"Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-12-22T21:46:28Z","receivedAt":"2016-12-22T21:47:02Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, Dec 22, 2016 at 1:14 PM, Stefan Monov <logixoul@gmail.com> wrote:\n> Hi.\n>\n> I'd like to use just:\n>\n>     git push\n>\n> or at most:\n>\n>     git push origin\n>\n> rather than having to first check which is the active branch with `git\n> branch --list`, then type:\n>\n>     git push origin <branch>\n>\n> At [1] and [2] I've seen that if I do this once:\n>\n>     git push -u origin <branch>\n>\n> then from then on I can use just `git push` _for that branch_.\n> However, I don't want to do this \"setup\" step for each branch, because\n> it's extra work that I also may forget to do.\n>\n> Why is this \"setup\" step necessary and can I avoid it?\n>\n> Thanks,\n> Stefan\n>\n> [1] http://stackoverflow.com/q/19312622\n> [2] http://stackoverflow.com/q/6529136\n\n\nTry setting \"push.default\" configuration setting, see \"git help\nconfig\" and search for push.default\n\nI *think* what you want is \"push.default = current\" but you should\nread up on each option.\n\nThanks,\nJake\n"},{"id":"308392","messageId":"CAJtFkWvE7_owqH0KET++Oxv9pDmygwnmDMnOE2r14hQN6BxFgw@mail.gmail.com","threadId":"44757","inReplyTo":"CA+P7+xpdKEoNY_cgY4g3bMVZe0p-2bYT4Y-3nYyd0O03iD1nZg@mail.gmail.com","subject":"Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it","fromName":"Stefan Monov","fromEmail":"logixoul@gmail.com","sentAt":"2016-12-27T17:47:58Z","receivedAt":"2016-12-27T17:48:23Z","isPatch":false,"sender":{"key":"logixoul@gmail.com","avatar":"https://gravatar.com/avatar/225c01274d1ead9f204fb7d8b871a9aad653bd3d80dd4356efc8c83fdbc750e4?d=mp&s=160"},"body":"Thanks guys!\n"}]}