git刪除遠程分支


  • git 刪除遠程分支
[root@Monitor Demo]# git branch -av
* master                    f105caa Merge branch 'psr/psr-02'
  psr/psr-01                7cd0be2 now this branch and master branch is both modified this file.
  psr/psr-02                62ca72c psr_psr-02.txt has changed on psr/psr-02 branch
  remotes/origin/HEAD       -> origin/master
  remotes/origin/master     f105caa Merge branch 'psr/psr-02'
  remotes/origin/psr/psr-01 33737de add one line.
[root@Monitor Demo]# git push --delete origin psr/psr-01
To git@github.com:hienha/Demo.git
 - [deleted]         psr/psr-01
[root@Monitor Demo]# git branch -av
* master                f105caa Merge branch 'psr/psr-02'
  psr/psr-01            7cd0be2 now this branch and master branch is both modified this file.
  psr/psr-02            62ca72c psr_psr-02.txt has changed on psr/psr-02 branch
  remotes/origin/HEAD   -> origin/master
  remotes/origin/master f105caa Merge branch 'psr/psr-02'
  • git重命名遠程分支,其實就是刪除遠程分支,然后重命名本地分支,然后推送到遠程分支
[root@Monitor Demo]# git branch
* master
  psr/psr-01
  psr/psr-02
[root@Monitor Demo]# git branch -m psr/psr-01 psr_psr-01
[root@Monitor Demo]# git branch
* master
  psr/psr-02
  psr_psr-01
[root@Monitor Demo]# git push origin psr_psr-01
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:hienha/Demo.git
 * [new branch]      psr_psr-01 -> psr_psr-01
[root@Monitor Demo]# git branch -av
* master                    f105caa Merge branch 'psr/psr-02'
  psr/psr-02                62ca72c psr_psr-02.txt has changed on psr/psr-02 branch
  psr_psr-01                7cd0be2 now this branch and master branch is both modified this file.
  remotes/origin/HEAD       -> origin/master
  remotes/origin/master     f105caa Merge branch 'psr/psr-02'
  remotes/origin/psr_psr-01 7cd0be2 now this branch and master branch is both modified this file.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM