LoginSignup
0
0

More than 5 years have passed since last update.

git 删除不需要的本地分支・远程分支

Posted at

本地分支

查看分支列表

  • 查看本地分支列表
$ git branch
master 
gh-pages

删除本地分支

  • 删除merge了的分支
$ git branch -d gh-pages
  • 删除分支(不管它有没有merge)
$ git branch -D gh-pages

远程分支

查看分支列表

  • 查看远程分支列表
$ git branch -r
origin/HEAD -> origin/master
origin/gh-pages
origin/master
  • 查看本地分支与远程分支列表 bash $ git branch -a master gh-pages origin/HEAD -> origin/master origin/gh-pages origin/master

删除远程分支

  • 删除远程的foo 分支
git push --delete origin foo

或者

git push origin :foo
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0