4 ms·
To be fair, there is "git branch <somebranch>" to create a new branch. Then you'll have to checkout that branch if you want to use it. Your third git example
by tux1968 7y ago
To be fair, there is "git branch <somebranch>" to create a new branch. Then you'll have to checkout that branch if you want to use it.
Your third git example above just combines those two operations into a single command as a convenience.
- jfim 7y agoThat's true, but from my perspective it makes more sense to attach combined operations to the first operation, not the following one. For example, the equivalent of git fetch (fetch remote code without updating the working copy) is hg pull, while the equivalent of git pull (fetch remote code and update the working copy) is hg pull -u (pull, then update). In my opinion, and this can be debated, is that it makes more sense to attach it to the first operation, since one would look at the documentation of the first command (how do I fetch the remote code?) then see that the working copy can be updated as part of that. The git documentation does mention git checkout -b as part of the git branch documentation, though. Maybe this is just a rant against git though, at the end of the day, as long as work gets done, use whatever tools work for you. :-)