4 ms·
I don't know why, but I always end up telling every single person who either 1) Bitches about git, or 2) asks for help, that I always, always, always tell "git
by endlessvoid94 14y ago
I don't know why, but I always end up telling every single person who either 1) Bitches about git, or 2) asks for help, that I always, always, always tell "git push" or "git pull" which remote and branch.
It's muscle memory and makes everything more explicit and easy to understand. Although, in this case, it sounds like you expect git to be intuitive. (Which it is not)
So this basically amounts to a blog post complaining that git is hard.
- barumrho 14y agoFrom my experience, git pull origin branch didn't do what I expected. (Pulling from the remote branch to the current branch.) I haven't figured out what it does, so I just use git fetch then merge. :(
- glitchdout 14y agoGit pull does a git fetch of the branch specified and then does a git merge into the current branch.
- deleted 14y ago[deleted]
- kstenerud 14y agoIt's a problem of user interface design. Git's user-machine interface does not follow the principle of least astonishment. It's not orthogonal. Functionality is grouped in very strange ways (you list, move, rename and delete branches with branch, but create branches using checkout? Seriously???). And don't even get me started on the nightmare that is submodules. The whole thing reminds me of the bad old unix days of "if it was hard to write, it should be hard to understand."
- deleted 14y ago[deleted]
- damncabbage 14y agoyou list, move, rename and delete branches with branch, but create branches using checkout? Seriously??? git checkout -b new-branch ... is a shortcut for: git branch new-branch git checkout new-branch You can create the branch or otherwise manipulate it without actually checking it out, so it's useful to have it separate and have a shortcut. (I agree that git's interface is terrible, but I disagree that this is one of those cases. :) )
- sjwright 14y ago> but I disagree that this is one of those cases I do think this is precisely one of those cases. "Branch" is a major, repo-modifying operation; "checkout" is a trivial context switch operation. The user interface disaster here was that the major operation is treated as subservient to the trivial operation. It should be the other way around. Therefore, the shortcut for creating a branch and switching to it should be git branch -c new-branch whereby the -c switch checks you into that branch immediately.