Git 常用命令速查表

"常用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$

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值