mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-03-10 12:48:43 -03:00
Merge pull request #79 from RichardLitt/feature/delete-branch
Added explanation for deleting a branch
This commit is contained in:
commit
65e60c8e89
22
README.md
22
README.md
@ -52,6 +52,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
|
||||
- [I accidentally deleted my branch](#i-accidentally-deleted-my-branch)
|
||||
- [I want to delete or remove my last commit](#i-want-to-delete-or-remove-my-last-commit)
|
||||
- [Delete/remove arbitrary commit](#deleteremove-arbitrary-commit)
|
||||
- [I want to delete a branch](#i-want-to-delete-a-branch)
|
||||
- [Delete tag](#delete-tag)
|
||||
- [Deleted Patch](#deleted-patch)
|
||||
- [Check if all commits on a branch are merged](#check-if-all-commits-on-a-branch-are-merged)
|
||||
@ -683,6 +684,27 @@ $ git rebase --onto SHA1_OF_BAD_COMMIT^ SHA1_OF_BAD_COMMIT
|
||||
$ git push -f [remote] [branch]
|
||||
```
|
||||
|
||||
<a name="i-want-to-delete-a-branch"></a>
|
||||
### I want to delete a branch
|
||||
|
||||
To delete a remote branch:
|
||||
|
||||
```sh
|
||||
(master)$ git push origin --delete my-branch
|
||||
```
|
||||
|
||||
You can also do:
|
||||
|
||||
```sh
|
||||
(master)$ git push origin :my-branch
|
||||
```
|
||||
|
||||
To delete a local branch:
|
||||
|
||||
```sh
|
||||
(master)$ git branch -D my-branch
|
||||
```
|
||||
|
||||
<a name="delete-tag"></a>
|
||||
### Delete tag
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user