2 ms·
`And how should I create a branch?. Use git checkout.` No. You create a branch with git branch. If you want to create a branch and immediately switch to it, use
by wereHamster 14y ago
`And how should I create a branch?. Use git checkout.` No. You create a branch with git branch. If you want to create a branch and immediately switch to it, use git branch (to create it) + git checkout (to switch to it). git checkout -b is just a shorthand for the two, it's there just for convenience. Unix has a lot of these occurrences. rm -rf as a shorthand for rm+rmdir, the open() syscall with O_CREAT shorthand for creat()+open() etc.
- sirclueless 14y agoBy the way, rm -rf does a lot more than rm+rmdir. You will probably learn this the hard way soon enough, unless you already know this and are just oversimplifying to show a point.