zoukankan      html  css  js  c++  java
  • git命令行删除远程分支

    先查看远程分支

    git branch -r


    使用下面两条命令来删除远程分支

    git branch -r -d origin/branch-name
    git push origin :branch-name

    update:

    解释一下上面的参数含义:

    -r, --remotes
    List or delete (if used with -d) the remote-tracking branches.


    上面的第一句是删除了本地的远程跟踪分支( 我也不知道怎么描述更加清楚),此时使用git branch -a查看,分支remotes/origin/branch-name应该已经不存在了。

    为什么还需要第二句,因为上面只是把本地的远程跟踪分支删除了,远程的分支还没有删除,所以第二句就是真正的删除原种分支。

    若出现错误  重新操作  

    Pushing an empty <src> allows you to delete the <dst> ref from the remote repository.
  • 相关阅读:
    公用导航栏的根据url控制选中导航js
    页面切换出动晃动解决
    redis五大数据类型
    redis简介
    Linux安装redis
    各种锁的理解
    原子引用
    理解CAS
    彻底玩转单例模式
    Volatile
  • 原文地址:https://www.cnblogs.com/mzdljgz/p/11475636.html
Copyright © 2011-2022 走看看