Next, you will pass in the name of the branch you wish to delete. This helps prevent you from accidentally losing commit data. The git branch command will pull a list of all the local branches in your Git repository.
But be warned! Using the -D flag too often can make losing data very easy, so use with caution. Try this instead:. This will push nothing the part before the colon to your origin server and overwrite master.
In other words, it should delete the master branch remotely. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How do Git branches work? Can I remove the master branch? Ask Question. Asked 11 years, 11 months ago. Active 2 years, 8 months ago. Viewed 34k times. Improve this question.
Add a comment. Active Oldest Votes. Now, if you had access to the computer that contains the master repository you could log in and run: git branch -d master However, if you aren't able to do that, you can still do it from your local machine. Getting started with git gui on Windows.
Gitwash build. Navigation index next previous pydagogue 0. You clone your fork. It can be tempting to do work in the master branch and ask for a pull request. Web Development Website Optimization Websites need to load fast to make visitors happy. Try Tower - For Free. How do I delete a local branch in Git? Can I undo deleting a branch? In most cases, if you don't let too much time pass, you can restore a deleted branch.
Get our popular Git Cheat Sheet for free! New content and updates.
0コメント