News for hackers. Stuff that matters.
Re:Is Git Irreplaceable? (2019) by raducu on Tuesday January 07, 2020 @10:24AM (#21980749)
Is there a reason for -D and not -d? Wouldn't -D also delete the remote branch if you accidentally pushed your changes?
Re:Is Git Irreplaceable? (2019) by vvillena on Tuesday January 07, 2020 @12:40PM (#21982309)
"git branch -d" doesn't remove a branch if that means losing track of some local commits. "-D" doesn't check that. The "git branch" commands only operate on your local repo, they don't push any changes to remote repos and they don't pull commits from anywhere.
Re:Is Git Irreplaceable? (2019) by WorldMaker on Tuesday January 07, 2020 @01:51PM (#21983222)
`-D` doesn't involve the remote at all (unless you are using something like the intentional remote:branch syntax which this example isn't). It is a force delete in that if there were commits locally in that branch and only in that branch it should still delete that branch. It should be unlikely you need that force because the first step was to branch everything as is, so it is safer to just use `-d`, but if the intention is to "blat" it from orbit anyway, `-D` is that.