2 ms·
> pointers to commits Or to use the name git gives to that concept, "refs." Thus reflog :) Also, one thing that I've found hasn't occurred to most people usin
by derefr 3y ago
> pointers to commits
Or to use the name git gives to that concept, "refs." Thus reflog :)
Also, one thing that I've found hasn't occurred to most people using git, is that all the branch/tag/etc refs of your fetched remotes, are also refs, able to be referenced anywhere you can name a ref.
For example, if you ever want to say "I don't care what's on this branch, don't fast-forward or merge or rebase, just overwrite my local branch with what's on the remote!" then that'd be:
git checkout foo
git reset --hard origin/foo
- sakisv 3y agoAh yes, the fact that git brings the remote stuff locally when you `git pull` and all the `origin/<whatever>` are just branch names is something that I realised only too late. As for the refs, yes, good point ;)
- xorcist 3y agoWhen you do 'git fetch'. The 'pull' is just an alias for fetch + merge (or rebase, depending on local settings).
- mjochim 3y ago> Or to use the name git gives to that concept, "refs." Thus reflog :) A command name that I read as re-flog for the longest time :D. I really wondered about the strange, strange name for quite a while before I bothered to look up what it does and found out that I should read it as ref-log and that it is, indeed, a very useful thing.
- trillic 3y agoThe humans will be flogged and reflogged until they understand the distributed version control
- xmprt 3y agoI had the same experience for the longest time until one day I'd have to "re-flog" my local git because I reset some commits that I shouldn't have. Turns out that flogging isn't a real thing in git let alone re-flogging the commits again.
- imetatroll 3y agoWow I've been using git for years and for some reason that never clicked for me. Thanks for pointing that out. Also being a de-refr probably helps.