3 ms·
I love writing hardcore C code full or pointers and cross-calls but for some reason I can't get bothered with semi-advanced Git. There's a dread, a fatigue...
by alcover 4y ago
I love writing hardcore C code full or pointers and cross-calls but for some reason I can't get bothered with semi-advanced Git.
There's a dread, a fatigue... I got burned merging (or was it rebasing?) and now I often just copy my folder to make a temp branch.
By the way, how do you extract a file from an old commit without checking out (and crushing your current files..) ? No hassle with the old folder-copy-tech !
- OkayPhysicist 4y agoAre you looking to replace the current version of the file (undoing changes to the file back to a past commit) or are you trying to make a new file containing the contents of the file at the time of the past commit? For the former, there's git checkout <branch> -- <filepath>, which has been given it's own command as git restore --source <branch> filename. For the latter, there's git show <ref>:<filepath>, which you then pipe into the file you want to write, like git show master:src/main.js > temp_main_old.js
- alcover 4y agoI meant the latter. This is very helpful ! Thx a lot.