git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andrew Ardill <andrew.ardill@gmail.com>
To: 夏大雨 <xia.jason23@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Branch name support & character
Date: Thu, 7 Sep 2017 15:31:33 +1000	[thread overview]
Message-ID: <CAH5451m9asxzaOEzQ2Jjk9Ly97GVnb7DV0uZS=96B=yHCYLWCw@mail.gmail.com> (raw)
In-Reply-To: <CA+zMtjmhrE54=ke6vVDGOcrbHkdPuE-Gf5cwQEp8LL2h+xen0g@mail.gmail.com>

Hi,

On 7 September 2017 at 13:27, 夏大雨 <xia.jason23@gmail.com> wrote:
> I want to merge branch a to branch b so I rename branch b to a&b, but
> when I push a&b to remote repo, '&' is took as & operator for shell,
> and git push fails. So it would be better that branch name support &
> character for me.

Have you tried quoting the branch name?

Using git checkout -b 'my&branch' works for me (single quotes around
the branch name).

Pushing to a local remote also works: git push --set-upstream
../git-test-2 'my&branch'

That being said, I would advise not using & in branch names,
specifically because it is a special character in shells.

Regards,

Andrew Ardill

  reply	other threads:[~2017-09-07  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07  3:27 Branch name support & character 夏大雨
2017-09-07  5:31 ` Andrew Ardill [this message]
2017-09-08  1:18   ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAH5451m9asxzaOEzQ2Jjk9Ly97GVnb7DV0uZS=96B=yHCYLWCw@mail.gmail.com' \
    --to=andrew.ardill@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=xia.jason23@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).