News for hackers. Stuff that matters.
Re:Git Undo by Mchl on Thursday August 25, 2016 @07:16AM (#12358149)
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.
Re:Git Undo by panic on Thursday August 25, 2016 @08:00AM (#12358341)
Git 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.
Re:Git Undo by OJFord on Thursday August 25, 2016 @07:34AM (#12358228)
That's all a Git branch is though; so it makes perfect sense for the command `git branch` to do that.
Re:Git Undo by krupan on Thursday August 25, 2016 @12:18PM (#12360266)
You are absolutely right and I'm sorry to see you getting downvoted. See:

http://bryan-murdock.blogspot.com/2013/06/git-branches-are-n...

Re:Git Undo by phaemon on Thursday August 25, 2016 @07:26AM (#12358196)
It 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.
Re:Git Undo by nf05papsjfVbc on Thursday August 25, 2016 @07:31AM (#12358218)
You can look at it as a copy-on-write optimisation. It may not be so poorly named if you look at it that way.
Re:Git Undo by parenthephobia on Thursday August 25, 2016 @11:02AM (#12359514)
I 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.

Re:Git Undo by WillAbides on Thursday August 25, 2016 @09:52AM (#12358960)
What do you think `git branch` should do?
Re:Git Undo by ISL on Thursday August 25, 2016 @10:16AM (#12359145)
It creates a branch of zero length.