Junior post. Senior comments.
Senior Dev:
"You forgot the 5th horseman: giving ```chmod -R 777 /``` in production because 'it wasn’t working'."
Too much juniors this days
Imagine a future where AI kills off all the junior devs, and then this sub actually becomes quality
Well there is some work done, look on what they're wasting their time because they don't haven't work
git reset --hard HEAD@{1}
git reset --hard
only moves the HEAD pointer. You can always go back unless you orphan some commits and wait long enough that the git garbage collector removes them. git reset --hard HEAD@{1}
will go back to where you were. If you move HEAD multiple times, you can use a different number to go to N heads ago.
git reset --soft
only moves the HEAD pointer. All other modes can potentially affect the index or working copy.
This is the actual correct answer.
wrong
Tell me you don't know git without telling me you don't know git.
git push origin master
git reset --hard HEAD~3
git gc
git push --force
Still doesn't delete the history - reflog will be kept. Unless you manually expire it.
I am now let go from my toxic bank dev job, thanks to you.
git rebase -i --root
<delete random `pick` lines near the beginning of time>
git gc
git push --force origin master
git reset --hard ORIG_HEAD
If only there was some sort of log of your refs 🤔
Did this the other day, was at the point where I just wanted to start over from scratch haha
Just commit your .git directory in git. #shittylifehacks
copy your entire repo on a backup hard drive smh. 3-2-1 rule people!
reflog says hi
rm -rf .git
would be more catastrophic
How about randomly changing history and pushing?
kid named backups
All seniors in comment section ⭐⭐⭐⭐⭐
git push -f
// # Les carottes sont cuites
Putting toothpaste back in is not that difficult
bah, Idk how that would be any way difficult to undo, you just need to get the last commits back from the repo and then point again to the new HEAD.
If it was an unpushed commit that won't work, but you can always git reflog
. And then reset to the head before you reset.
knowledge, I have forgotten that no everyone pushes as soon as the commit is done
So no head?
There's a couple of ways to tackle this but my preferred method of dealing with this is just putting the stash on its own feature branch and then coming back later to merge whatever I need to merge. It sounds like you don't know how to use git.
Just use jj instead of git
git reflog
My life got so much better when I learned about
git reflog
My life got less fun when I learned that it's pronounced "ref log" rather than a way to beat git into submission.
With the number of times its fixed my repo, por que no los dos?
I mean, I'm not going to force you to pronounce it "ref log" if you prefer the alternative!
Oh good. How about mispronouncing
fstab
?There are two valid ways to pronounce it. One is:
/etc/fs<tab>
which is the way I type it (since "fs" is a unique prefix within my etc directory). The other is entirely valid and probably more accurate when things are going wrong. Go ahead, stab that f.You mean fist ab?