Git development
 help / color / mirror / Atom feed
From: Mohit Aron <mohit.aron@gmail.com>
To: git@vger.kernel.org
Subject: git push should automatically push to remote tracking branch
Date: Sun, 18 Oct 2009 13:20:22 -0700	[thread overview]
Message-ID: <ee22b09e0910181320j15a273e8vc510801c890b93a9@mail.gmail.com> (raw)

Hello,

I've been using git for around a year now and I'm continuing to find
the 'git push' API rather cumbersome. My workflow is as follows. I
typically have a local branch track a remote branch and want to pull
and push changes back and forth. The names of the local and remote
branches are different. Even so, while 'git pull' is enough to pull
changes, 'git push' is not. Instead, the pull requires a full refspec
to be specified which gets real cumbersome and error prone.

Say my local branch name is foo and it is tracking a remote release
branch of a product. Say the remote's name is origin and corresponding
branch there is 6.1. 'git pull' nicely fetches and merges changes
submitted by others in the remote branch to my branch foo. However, to
do a push, I need to call:

      git push origin HEAD:6.1

Since my local branch has been setup to track the remote branch, I
shouldn't have to specify all this in the 'git push' command. It'll be
great if 'git push' were to support a variant that automatically
allows pushing to the remotely tracked branch. This is the typical
workflow with other version control systems too.

If anyone knows a simpler alternative I can use in Git, please let me
know. Otherwise, it'll be great if such a feature could be added to
Git in the future.


- Mohit

             reply	other threads:[~2009-10-18 20:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 20:20 Mohit Aron [this message]
2009-10-18 23:11 ` git push should automatically push to remote tracking branch Tomas Carnecky
2009-10-19  3:50   ` Mohit Aron
2009-10-19  5:06     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee22b09e0910181320j15a273e8vc510801c890b93a9@mail.gmail.com \
    --to=mohit.aron@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox