Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ampersand(&) and underscore(_) issue in git command line [duplicate]

I created a repository(private) in github and cloned it to the local machine,pushed stuff and everything was fine. I added a collaborator and he created a branch named r&d_story i wanted to work on that branch, so when i tried to clone/pull it to the local machine i am not able to do it because i get an error as follows:

$ git pull origin r&d_story

$fatal: couldn't find remote ref r
'd_story' is not recognized as an internal or external command,
operable program or batch file.

Searched everywhere regarding the issue no one seems to face it. can anyone please explain what is wrong?

like image 273
heeat Avatar asked Oct 16 '25 09:10

heeat


1 Answers

You need to escape the special character &, using this either:

On Unix (Linux or Mac)

  • git pull origin r\&d_story
  • git pull origin 'r&d_story'

On Windows

  • git pull origin "r&d_story"
like image 149
jburtondev Avatar answered Oct 19 '25 00:10

jburtondev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!