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.

24 comments:

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

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

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

    ReplyDelete
  4. 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.

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

    ReplyDelete
  6. 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

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

    ReplyDelete
  8. nice code bro article are awesome follow my blog for php www.gajabwap.blogspot.in

    ReplyDelete
  9. Great post, thanks for sharing..

    ReplyDelete
  10. Thanks for sharing such a nice information with us. Very useful lines and to the point.

    CakePHP Most Common Interview Questions Answers
    OOPS Interview Questions Answers

    ReplyDelete
  11. Undoubtedly, a great deal of informative and alluring guidance imparted by you. I can certainly say that this might benefit many seekers. Thank you for sharing this article. Keep blogging.
    Website Design Agency | Website design company

    ReplyDelete
  12. This site is help full for every person and easily get money through bitcoin atm card . Please visit this site for bitcoin atm card ranking.you can change any money into another currency in any where in the world.

    ReplyDelete
  13. Here you will find permanent seo solutions to your web project, You can save cost to find more customers online with organic search engine marketing techniques.

    ReplyDelete
  14. Thank you for your information provided it will useful and helpful
    Best Play and Pre School for kids in Hyderabad,India. To give your kid a best environment and learning it is the right way to join in play and pre school were kids can build there physically, emotionally and mentally skills developed. We provide programs to kids like Play Group, Nursery, Sanjary Junior, Sanjary Senior and Teacher training Program.
    ­play school in hyderabad

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Good blog information and it will helpful and useful
    Sanjary Academy is the best Piping Design institute in Hyderabad, Telangana. It is the best Piping design Course in India and we have offer professional Engineering Courses like Piping design Course, QA/QC Course, document controller course, Pressure Vessel Design Course, Welding Inspector Course, Quality Management Course and Safety Officer Course.
    Piping Design Course in Hyderabad ­

    ReplyDelete
  17. Excellent blog posting information of the author provided

    Pressure Vessel Design Course is one of the courses offered by Sanjary Academy in Hyderabad. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course,Welding Inspector Course, Quality Management Course, #Safety officer course.
    Welding Inspector Course
    Safety officer course
    Quality Management Course
    Quality Management Course in India

    ReplyDelete
  18. I just stumbled over this page and have to say - wow. The site is really good and kept up to date. Continue like
    Allahabad University BCom 1st, 2nd & 3rd Time Table 2020

    ReplyDelete
  19. I just stumbled over this page and have to say - wow. The site is really good and kept up to date. Continue like
    BCOM 1st, 2nd & Final Year TimeTable 2020

    ReplyDelete
  20. You’d outstanding guidelines there. I did a search about the field and identified that very likely the majority will agree with your web page.
    Agra University BCom 1st, 2nd & Final Year Time Table 2020
    Maharaja Surajmal Brij University BCOM 1st, 2nd & Final Year TimeTable 2020

    ReplyDelete

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide If you're looking to host a Laravel project on Hostinger’s hPa...