Git: Delete a branch (local or remote)
2014-11-04 03:27
405 查看
http://makandracards.com/makandra/621-git-delete-a-branch-local-or-remote
To delete a local branch
To remove a remote branch (if you know what you are doing!)
When you get the error error: unable to push to unqualified destination: the_remote_branch The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failed
to push some refs to ‘git@repository_name’
perhaps anyone else has already deleted the branch. try to synchronize your branch list with
The git manual says -p, –prune After fetching, remove any remote-tracking branches which no longer exist on the remote.
To delete a local branch
git branch -d the_local_branch
To remove a remote branch (if you know what you are doing!)
git push origin :the_remote_branch
Note
When you get the error error: unable to push to unqualified destination: the_remote_branch The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failedto push some refs to ‘git@repository_name’
perhaps anyone else has already deleted the branch. try to synchronize your branch list with
git fetch -p
The git manual says -p, –prune After fetching, remove any remote-tracking branches which no longer exist on the remote.
相关文章推荐
- [Git]setting an existed local branch to track a remote branch
- How to Push a New Local Branch to a Remote Git Repository
- How to delete the remote branch in git
- Git CMD - branch: List, create, or delete branches
- Git- [!remote rejected]:refusing to delete the current branch
- GIT删除remote/local tag
- Git notes about remote branch
- How to Delete a remote Git tag
- git 撤销分支删除 操作 (git delete branch undo)
- git reset /delete remote respository commit
- git branch&&rebase&&remote
- Track all remote git branches as local branches
- Android Studio中Git更新本地的远程(remote)branch列表?
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- (git问题)解决The current branch is not configured for pull No value for key remote.origin
- git pull error (no local branch)
- git branch --set-upstream=origin/<branch> <local_branch>
- git之remote branch controller(远程分支控制)
- Git remote branch 远程分支管理
- git push and delete remote branches