5 ms·
Git already has `git branch` which doesn't in fact do any kind of branching but creates a label which follows commits when it's checked out.
by Mchl 10y ago
Git already has `git branch` which doesn't in fact do any kind of branching but creates a label which follows commits when it's checked out.
- phaemon 10y agoIt doesn't immediately make any kind of branch, but if you then create commits using both of the labels it will inevitably create a branch in the DAG so it's not terribly misnamed.
- nf05papsjfVbc 10y agoYou can look at it as a copy-on-write optimisation. It may not be so poorly named if you look at it that way.
- OJFord 10y agoThat's all a Git branch is though; so it makes perfect sense for the command `git branch` to do that.
- panic 10y agoGit also has 'git revert' which creates a new commit, 'git reset' which actually reverts (among other things), 'git checkout' which switches branches... the fact that all the other commands are confusing doesn't mean this new one has to be.
- WillAbides 10y agoWhat do you think `git branch` should do?
- ISL 10y agoIt creates a branch of zero length.
- parenthephobia 10y agoI think git branch only doesn't "branch" if you already have a differing idea of what a "branch" should be from another revision control system. For example, I consider that CSV and Subversion don't have branches, but just "copies". To my mind, what git branch does is exactly what branching is.
- krupan 10y agoYou are absolutely right and I'm sorry to see you getting downvoted. See: http://bryan-murdock.blogspot.com/2013/06/git-branches-are-not-branches.html http://bryan-murdock.blogspot.com/2013/06/git-branches-are-n...