Hacker News new | past | comments | ask | show | jobs | submit login

Holy shit git!

I need to reset my git repo to match origin, is it git reset hard --HEAD or git reset HEAD --hard?

I'm like 90% sure they switch it with every update.




It's just git reset --hard. HEAD is implied.

Edit: To be more specific:

    git  # the executable
    reset  # the operation
    --hard # the type of reset being done (hard reset)
    HEAD  # where to reset *to*. Defaults to HEAD if not specified.


You can just leave out HEAD since it is implied, but understanding a little bit about git, like what the head is supposed to be, would probably help you.


For rare commands that are repeated every so often history search comes in handy.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: