Thursday, November 27, 2025

How to Delete Branch

  

Delete branch locally:

 

# If you're on the branch, first switch to another (e.g., master/main)

git checkout master or git checkout main

 

# Delete local branch

git branch -d branch_name    # safe delete (won't delete if unmerged)

git branch -D branch_name    # force delete (even if unmerged)



Delete branch from remote:

 

git push origin --delete branch_name

 


 Thank you.

No comments:

Post a Comment

How to work with Meta‑Repository in GIT

Output looks like below: We are grouping multiple git repository under single git repository using SubModules concept. Each submodule is a g...