Reputation: 739
why "git push git push origin local-branch :development" will delete remote development branch?
jackiewillen ~/Documents/work/ git push origin yrh-deskmonitor-20170905 :development
Enter passphrase for key '.ssh/id_rsa':
To ssh://git.dianpingoa.com/ed-f2e/gandalf-plus.git
- [deleted] development
i try "push origin local-branch:development" is ok!So problem is on the semicolon;with space before semicolon or not is different.Why?
Upvotes: 2
Views: 652
Reputation: 7706
From the documentation of the git push:
git push origin :experimental
Find a ref that matches experimental in
the origin repository (e.g. refs/heads/experimental), and delete it.
Upvotes: 3
Reputation: 17455
The problem is the space between yrh-deskmonitor-20170905 :development
You've pushed yrh-deskmonitor-20170905
as is AND deleted development
branch
Probably, you wished to run
git push origin yrh-deskmonitor-20170905:development
instead.
The syntax of git push
is like this:
git push <target> <refspec1> <refspec2> <refspec3>
where all <refspec>s
are independent from each other and each may be in the following forms:
<branch-or-tag-name>
<local-refname>:<remote-branch-name>
:<branch-or-tag-name>
various "hacks" when remote refs is specified with name starting with refs/...
.
Don't worry, you still can re-create development
branch (almost) without a harm by issuing git push <target> yrh-deskmonitor-20170905:development
Upvotes: 3