git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Wishlist for branch management
Date: Mon, 1 Feb 2010 02:31:55 +0100	[thread overview]
Message-ID: <20100201013155.GA11832@atjola.homenet> (raw)
In-Reply-To: <4B662BEF.7040503@zytor.com>

On 2010.01.31 17:18:39 -0800, H. Peter Anvin wrote:
> git branch --current
> 
> ... list the current branch name, for use in scripts.  Equivalent to:
> 	"git branch | grep '^\*' | cut -c3-"

In scripts, plumbing should be used. I use:
	git rev-parse --symbolic-full-name HEAD

This gives either the full refname of the checked out branch head, e.g.
refs/heads/master, or HEAD in case of a detached HEAD.

> git push --current
> 
> ... push the current branch, and only the current branch...

Unless you want to push to a different ref remotely, e.g. pushing
refs/heads/master-public to refs/heads/master, you can use:
	git push <remote> HEAD

For example, when refs/heads/master is checked out, then:
	git push origin HEAD
acts the same as:
	git push origin refs/heads/master

Björn

  reply	other threads:[~2010-02-01  1:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01  1:18 Wishlist for branch management H. Peter Anvin
2010-02-01  1:31 ` Björn Steinbrink [this message]
2010-02-01  3:22   ` H. Peter Anvin
2010-02-01  9:19 ` Petr Baudis
2010-02-01 17:49   ` H. Peter Anvin

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=20100201013155.GA11832@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=hpa@zytor.com \
    /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;
as well as URLs for NNTP newsgroup(s).