Skip to content

Commit

Permalink
Update git-branch.md
Browse files Browse the repository at this point in the history
to delete a remote branch, you have to add the parameter --delete

https://www.educative.io/edpresso/how-to-delete-remote-branches-in-git
  • Loading branch information
filipve1994 authored Jan 7, 2020
1 parent bc51528 commit f2844ae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions git-branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ List outdated branches that have been merged into the current one.
git branch -D $branchname
```

Delete a branch irrespective of its merged status.
```bash
git branch -d $branchname
```

> Note: You can also use the -D flag which is synonymous with --delete --force instead of -d. This will delete the branch regardless of its merge status.
> Delete a branch irrespective of its merged status.
### Delete remote branch

```bash
git push origin :$branchname
git push origin --delete :$branchname
```

Works for tags, too!
Expand Down

0 comments on commit f2844ae

Please sign in to comment.