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

Quick, what does git pull foo do if foo is a branch vs a remote and how do you fix it if you messed up/which is preferred when both exist?


> if foo is a branch

It does `git pull <default remote> foo`.

> vs a remote

It gives an error, because you haven't specified the remote.

I don't know what behaviour you find intuitive here?

> how do you fix it if you messed up/which is preferred when both exist?

git pull is YOLO mode, so I never do it, but I would just reset the branches where I want them to be? You get a summary with the old and new commit hashes, so resetting is really easy.


I've never encountered this case in real life, so I don't know. Maybe I'll try later out of curiosity.

But whatever state I'm in, I'm sure I can reset back to where I were using reflog.




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

Search: