5 ms·
Do git's CLI UX choices buy it power? Or, conversely: does git checkout being for switching branches, creating branches (but not listing or deleting them), and
by lvh 10y ago
Do git's CLI UX choices buy it power? Or, conversely: does git checkout being for switching branches, creating branches (but not listing or deleting them), and also checking out files from the version at a ref (sometimes) mean that git gets useful new features?
- __david__ 10y agoYes? Having checkout handle creating branches is strictly a shortcut. The other option for the shortcut would be for `git branch` to sometimes alter state in your working directory (it currently never does this). The non-shortcut version (which works today) is to only create branches with `git branch` and only checkout branches with `git checkout`. If you look at it from the perspective of "checkout is the thing that screws with your local working directory", it is organized logically.
- OJFord 10y ago> Do git's CLI UX choices buy it power? Or, conversely: does git checkout being for switching branches, creating branches (but not listing or deleting them), and also checking out files from the version at a ref (sometimes) Branch management: # creation git branch foobar # listing git branch # renaming git branch -m barfoo # relocation git branch -f barfoo # deletion git branch -d barfoo Working directory management: # change WD to branch git checkout foo # change WD to state of HEAD git checkout -- . # change WD to new branch forking HEAD git checkout -b bar # ... As an aside, `--` is UNIX for 'end of options'; nothing git-specific. I mention this because that's another thing that seems to come up with people saying it's some mad git option that makes no sense and you just have to remember it. > mean that git gets useful new features? I don't really understand what you mean by this. Is something only 'powerful' if it 'gets useful new features'? -- I'm not saying it's easy for newcomers, I'm just saying the difficulty is biased to the early stages of the learning curve (I certainly experienced it, I used to fear git - now I fear lack of it) and disputing the claim that it isn't powerful.
- lvh 10y agoI think we're mostly in violent agreement that there's a pretty steep learning curve. That is also true for some other tools. I'm questioning the link between steep curve and powerful; it is true that many powerful tools have steep learning curves; but one can easily think of tools that have steep learning curves but are not powerful. So, the question is: is git's CLI just weird, or does it need to be weird in order to be successful as an SCM? (I think it's the former.)