How to list and delete branches
2016-07-29 16:15
344 查看
List branches
# list your local branches $ git branch # list your remote branches $ git branch -r # list both remote and local branches $ git branch -a
See the last commit on each Branch
$ git branch -v
List merged or not merged branches
# list the branches that are already merged into the branch you're on $ git branch --merged # list the branches that contain work you haven't yet merged in $ git branch --no-merged
Delete branches
# delete a local branch $ git branch -d <<local_branch_name>> # delete a remote branch $ git push origin :<<remote_branch_name>>
If you have other branches that contain work that haven’t merged in yet, trying to delete it with
git branch -dwill fail.
But if you really do want to delete the branch and lose that work, you can force it with -D.
# force to delete an unmerged branch $ git branch -D <<local_branch_name>>
Reference
Git Branching - Branch ManagementHow to list and delete branches
相关文章推荐
- How to disable certain HTTP methods (PUT, DELETE, TRACE and OPTIONS) in JBOSS7 .
- How to add,edit and delete key-value in localStorage of Browse
- python: how to delete a given item if it exist in the list
- How to create and delete a SharePoint site by web application
- How to delete subfolders and files in a folder
- 15 Minute SEO List - Learn how to SEO:List of Best and Worst practices for designing a high traffic website
- define a class for a linked list and write a method to delete the nth node.
- How to Use Hyper-V Snapshot Revert, Apply, and Delete Options
- HowTo: ListView, Adapter, getView and different list items’ layouts in one ListView
- How to nagivate to a list item by site id, web id,list id and item id.
- How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file
- define a class for a linked list and write a method to delete the nth node.
- How to delete a large number of data in SharePoint for List when refreshing data?
- List of maintainers and how to submit kernel changes
- How to Create and Delete VLAN on Cisco Catalyst Switch
- Spring Form Tags - How to use Text Box, Radio Button, Check Box and Drop Down List in Spring
- How to implement check box in listView Android to delete listItems
- About UID and How to autostart an application on boot up in 3rd- Startup List Management API
- how to merge dict and list
- How to Delete and Recreate the _msdcs DNS zone on a Windows DNS Server