Sunday, November 26, 2017

How do I delete a Git branch both locally and remotely?

To delete Locally - (Normal),
git branch -d my_branch
If your branch in rebasing/merging progress and that was not done properly means, you will get an error Rebase/Merge in progress so in that case, you won't be able to delete your branch.

So either your need to solve rebasing/merging otherwise you can do force Delete by using,

git branch -D my_branch
To delete in Remote:

git push --delete origin my_branch
can do the same using ,

git push origin :my_branch   # easy to remember both will do the same.


  1. I was looking for this command lines. Thank you!

  2. Australia Best Tutor is providing online Assignment Help Services for colleges and universities students. Here Students are getting best results and better grades.

    Discount Code : ABT30

    For More Information
    Online Assignment Help
    Assignment Help
    Instant Assignment Help
    My Assignment Help
    Help with Assignment
    Accounting Assignment Help

  3. Best of the interview question on the php language. I think i got the php classes from you.

  4. PHP is a booming sector in IT industry. Grandmaster online provides online training in PHP, Java, Python, Web designing and development all across India.

  5. Thanks for sharing this information And...
    E-school Bareilly

    We provide Project and tutorial from E-school you can learn everything that will help you to Increase your coding knowledge.

  6. it's a very great post. thanks for sharing with us. such a it's very useful for us.
    PHP training in Chandigarh

  7. CIIT Noida provides Best MCA Courses in Noida based on the current IT industry standards that help students to get high paying jobs in Top MNCs. CIIT provides Best MCA Training in Noida, Greater Noida, and Ghaziabad. CIIT is one of the trusted MCA training institutes in Noida providing practical knowledge and 100% job assistance with basic as well as advanced level MCA subjects. CIITN is the best MCA college in Noida, greater noida, ghaziabad, delhi, gurgaon regoin.

    At CIIT MCA classes in Noida is conducted by subject experts corporate professionals with 9+ years of experience in managing real-time and live projects. Sofracle Nano Specialized MCA classes Noida is the perfect blend of academic learning and practical sessions to provide maximum exposure to students that transform an average student into a corporate professional whom companies prefer to hire.

    Best MCA College in Noida

  8. I am really happy to say it’s an interesting post to read. I learn new information from your article, you are doing a great job.
    php training in IndoreKeep Posting:)

  9. Nice Information Thank You For Sharing Keep Sharing PHP Training In Chandigarh


Related Posts Plugin for WordPress, Blogger...