"常用Git命令速查表"
master:默认开发分支 origin:默认远程版本库 Head:默认开发分支 Head^:Head的父提交
Git常用命令速查表
删除远程仓库不存在的分支
可以查看远程库的一些信息,及与本地分支的信息。有时候可能遇到如下情况
git remote show origin
Yalin:publicRepository xiangyalin$ git branch -a "查看所有分支信息"
* master
remotes/origin/release
remotes/origin/snapshot
Yalin:publicRepository xiangyalin$ git push origin -d release "删除远程分支"
error: unable to delete 'release': remote ref does not exist "提示远程分支不存在"
error: failed to push some refs to 'https://github.com/vcfriend/maven'
Yalin:publicRepository xiangyalin$
Yalin:publicRepository xiangyalin$ git remote show origin "显示远程分支信息"
* remote origin
Fetch URL: https://github.com/vcfriend/maven
Push URL: https://github.com/vcfriend/maven
HEAD branch: master
Remote branches:
master new (next fetch will store in remotes/origin)
refs/remotes/origin/release stale (use 'git remote prune' to remove) "显示远程分支已经被删除"
refs/remotes/origin/snapshot stale (use 'git remote prune' to remove) "显示远程分支已经被删除"
Local ref configured for 'git push':
master pushes to master (local out of date)
Yalin:publicRepository xiangyalin$ git remote prune origin "删除不存在的远程分支信息"
Pruning origin
URL: https://github.com/vcfriend/maven
* [pruned] origin/release
* [pruned] origin/snapshot
Yalin:publicRepository xiangyalin$
Yalin:publicRepository xiangyalin$ git branch -a "查看所有分支信息"
* master
Yalin:publicRepository xiangyalin$