User Tools

Site Tools


rename_branch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rename_branch [2021/01/20 15:26] chifekrename_branch [2023/09/14 06:06] (current) – external edit 127.0.0.1
Line 20: Line 20:
 <code>git branch -d <local-branch></code> <code>git branch -d <local-branch></code>
  
 +In some cases, Git might refuse to delete your local branch: when it contains commits that haven't been merged into any other local branches or pushed to a remote repository. This is a very sensible rule that protects you from inadvertently losing commit data.
  
 +If you want to delete such a branch nonetheless (e.g. because you've programmed yourself into a dead end and produced commits that aren't worth keeping) you can do so with the "-D" flag:
 +
 +<code>git branch -D <local-branch></code>
rename_branch.1611156391.txt.gz · Last modified: 2023/09/14 06:06 (external edit)