{"thread":{"id":"21272","subject":"git push should automatically push to remote tracking branch","startedAt":"2009-10-18T20:20:22Z","lastAt":"2009-10-19T05:06:27Z","messageCount":4,"participants":["Mohit Aron","Tomas Carnecky","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125290","messageId":"ee22b09e0910181320j15a273e8vc510801c890b93a9@mail.gmail.com","threadId":"21272","inReplyTo":null,"subject":"git push should automatically push to remote tracking branch","fromName":"Mohit Aron","fromEmail":"mohit.aron@gmail.com","sentAt":"2009-10-18T20:20:22Z","receivedAt":"2009-10-18T20:20:22Z","isPatch":false,"sender":{"key":"mohit.aron@gmail.com","avatar":null},"body":"Hello,\n\nI've been using git for around a year now and I'm continuing to find\nthe 'git push' API rather cumbersome. My workflow is as follows. I\ntypically have a local branch track a remote branch and want to pull\nand push changes back and forth. The names of the local and remote\nbranches are different. Even so, while 'git pull' is enough to pull\nchanges, 'git push' is not. Instead, the pull requires a full refspec\nto be specified which gets real cumbersome and error prone.\n\nSay my local branch name is foo and it is tracking a remote release\nbranch of a product. Say the remote's name is origin and corresponding\nbranch there is 6.1. 'git pull' nicely fetches and merges changes\nsubmitted by others in the remote branch to my branch foo. However, to\ndo a push, I need to call:\n\n      git push origin HEAD:6.1\n\nSince my local branch has been setup to track the remote branch, I\nshouldn't have to specify all this in the 'git push' command. It'll be\ngreat if 'git push' were to support a variant that automatically\nallows pushing to the remotely tracked branch. This is the typical\nworkflow with other version control systems too.\n\nIf anyone knows a simpler alternative I can use in Git, please let me\nknow. Otherwise, it'll be great if such a feature could be added to\nGit in the future.\n\n\n- Mohit\n"},{"id":"125301","messageId":"1B59440B-5929-4AB9-82C7-05188DC4F959@dbservice.com","threadId":"21272","inReplyTo":"ee22b09e0910181320j15a273e8vc510801c890b93a9@mail.gmail.com","subject":"Re: git push should automatically push to remote tracking branch","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-10-18T23:11:21Z","receivedAt":"2009-10-18T23:11:21Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Oct 18, 2009, at 10:20 PM, Mohit Aron wrote:\n\n> Hello,\n>\n> I've been using git for around a year now and I'm continuing to find\n> the 'git push' API rather cumbersome. My workflow is as follows. I\n> typically have a local branch track a remote branch and want to pull\n> and push changes back and forth. The names of the local and remote\n> branches are different. Even so, while 'git pull' is enough to pull\n> changes, 'git push' is not. Instead, the pull requires a full refspec\n> to be specified which gets real cumbersome and error prone.\n>\n> Say my local branch name is foo and it is tracking a remote release\n> branch of a product. Say the remote's name is origin and corresponding\n> branch there is 6.1. 'git pull' nicely fetches and merges changes\n> submitted by others in the remote branch to my branch foo. However, to\n> do a push, I need to call:\n>\n>       git push origin HEAD:6.1\n>\n> Since my local branch has been setup to track the remote branch, I\n> shouldn't have to specify all this in the 'git push' command. It'll be\n> great if 'git push' were to support a variant that automatically\n> allows pushing to the remotely tracked branch. This is the typical\n> workflow with other version control systems too.\n>\n> If anyone knows a simpler alternative I can use in Git, please let me\n> know. Otherwise, it'll be great if such a feature could be added to\n> Git in the future.\n\n$ git config push.default tracking\n\ntom\n"},{"id":"125325","messageId":"ee22b09e0910182050k55efac83v6799285d992fcbb0@mail.gmail.com","threadId":"21272","inReplyTo":"1B59440B-5929-4AB9-82C7-05188DC4F959@dbservice.com","subject":"Re: git push should automatically push to remote tracking branch","fromName":"Mohit Aron","fromEmail":"mohit.aron@gmail.com","sentAt":"2009-10-19T03:50:57Z","receivedAt":"2009-10-19T03:50:57Z","isPatch":false,"sender":{"key":"mohit.aron@gmail.com","avatar":null},"body":"Thanks - I suppose this is a new config option. I'm running Git\nversion 1.6.0.4 (the latest with Ubuntu Jaunty) and that doesn't seem\nto have this option.\n\n\n- Mohit\n\n>\n> $ git config push.default tracking\n>\n> tom\n>\n>\n"},{"id":"125331","messageId":"20091019050627.GA16255@coredump.intra.peff.net","threadId":"21272","inReplyTo":"ee22b09e0910182050k55efac83v6799285d992fcbb0@mail.gmail.com","subject":"Re: git push should automatically push to remote tracking branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-19T05:06:27Z","receivedAt":"2009-10-19T05:06:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 18, 2009 at 08:50:57PM -0700, Mohit Aron wrote:\n\n> Thanks - I suppose this is a new config option. I'm running Git\n> version 1.6.0.4 (the latest with Ubuntu Jaunty) and that doesn't seem\n> to have this option.\n\nYes, it was added in v1.6.3.\n\n-Peff\n"}]}