Daniel
Daniel

Reputation: 597

Git remove branches

Can I remove branches using the commands below?

Local branch:

git branch -d <branchName>

Remote branch:

git push origin --delete <branchName>

Upvotes: 0

Views: 168

Answers (1)

Ash Wilson
Ash Wilson

Reputation: 24508

Yes.

One thing you should be aware of is that -d is a "safe" delete: it'll only let you delete a branch that's merged in to your current HEAD. If you want to delete any branch, use -D:

git branch -D <branchName>

Upvotes: 5

Related Questions