Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problem with git isn't following a tutorial, the problems I have had are nasty corner cases. I have to keep looking up strange a-symmetries, like why does 'git push' push just the current branch, and 'git pull' pull all branches? Then I have to look up how to make 'git pull' pull just the current branch.

Also, due to inconsistencies in how commands take branches, I sometimes realise I have a branch called 'origin/stuff', when I meant to do something with stuff on origin. It's also hard to find which branches are tracking what. Of course, you can find the options to do all these things. But there are just so many little things to learnt.

The fundamental question is, does the complexity of git come from the power it offers over svn, or does it come from the most terrible UI I think I have ever seen on a command line tool? I think it is the second.

I still use git every day, but I think it is putting usability by less computer-savvy users back years.



> like why does 'git push' push just the current branch, and 'git pull' pull all branches?

It's the opposite, "git push" pushes all branches and "git pull" only pulls the current branch. I think it's because push will only do fast-forward merges while pull will do any merge, and that could require a working directory to exist (but why not make push just push the current branch?)


Sorry yes, I got the asymmetry the wrong way around :)

The problem this causes (for me) is that if I have commits in other branches, 'git push' will fail (as other branches can't be fast-forwarded), but 'git pull' won't fix it. Of course, I can get around it, but it's annoying.


You can configure `git push` to push just the current branch to its configured remote, by setting 'push.default' to 'upstream'.

`git config --global push.default upstream`

The relevant docs (droplr'd, since you can't anchor-link into the online manpages): http://d.pr/Rlqn


What you mean when you say "you can get around it" is just specifying the branch you want to push. Just sayin'. It's not like you have to muck with settings and jump hoops.


The git maintainer is trying to fix this asymmetry by making "git push" only push the current branch (rather than all branches). It's a slow process to change the defaults in something as widely used as git because doing so breaks scripts.

See the new destined-to-become-the-default "simple" mode for "git push" in these release notes: https://raw.github.com/git/git/master/Documentation/RelNotes... .


> why does 'git push' push just the current branch, and 'git pull' pull all branches?

What version of git are you using? "git pull" definitely just pulls the current branch. It will fetch all the other remotes, but will only pull the current branch.


Which kind of makes sense, because you don't normally want to pull in all branches, just one particular be, but you often do want to push all your branches.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: