ProgrammerHumor

myStashOhMyPreciousStash

myStashOhMyPreciousStash
https://i.redd.it/ae0kbzwkhgcf1.png
Reddit

Discussion

Unupgradable
:cs::ts:

git reflog

1 week ago
diffyqgirl
:s:

My life got so much better when I learned about git reflog

1 week ago
mirrax

My life got less fun when I learned that it's pronounced "ref log" rather than a way to beat git into submission.

1 week ago
diffyqgirl
:s:

With the number of times its fixed my repo, por que no los dos?

1 week ago
rosuav

I mean, I'm not going to force you to pronounce it "ref log" if you prefer the alternative!

1 week ago
mirrax

Oh good. How about mispronouncing fstab?

1 week ago
rosuav

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.

1 week ago
TerminalVector

You mean fist ab?

1 week ago
AdmiralQuokka
:rust:

Jujutsu has an even stronger concept of the operation log, which tracks the entire state of your repository.

5 days ago
Sad_Cup_1324

Junior post. Senior comments.

1 week ago
programmerbud

Senior Dev:
"You forgot the 5th horseman: giving ```chmod -R 777 /``` in production because 'it wasn’t working'."

1 week ago
IrishChappieOToole

Ah the Dunning-Kruger command. Run by people who think they know everything about Linux, but are about to find out that they dont actually know all that much about Linux

6 days ago
Nervous_Teach_5596

Too much juniors this days

1 week ago
The-Flippening

Too many* these*

6 days ago
Nervous_Teach_5596

Thanks teacher, we don't have that there (can I edit that after a day?)

6 days ago
10art1
Software Engineer (:j:)

Imagine a future where AI kills off all the junior devs, and then this sub actually becomes quality

1 week ago
Nervous_Teach_5596

Well there is some work done, look on what they're wasting their time because they don't haven't work

1 week ago
gimme_pineapple

git reset --hard HEAD@{1}

1 week ago
harryham1
:j::ts::py:

Adding git reset --hard ORIG_HEAD

6 days ago
canihelpyoubreakthat

If only there was some sort of log of your refs 🤔

1 week ago
G0FuckThyself

Tell me you don't know git without telling me you don't know git.

1 week ago
_PM_ME_PANGOLINS_
:j::py::c::cp::js::bash:

They're posting on r/programmerhumor, of course they don't know git.

6 days ago
tyler1128
:cp::rust::py:

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.

1 week ago
sciolizer

git reset --soft only moves the HEAD pointer. All other modes can potentially affect the index or working copy.

1 week ago
UpgrayeddShepard

This is the actual correct answer.

1 week ago
Material-Piece3613

wrong

1 week ago
ColaEuphoria
:c::cp::py::asm::rust:

git push origin master

git reset --hard HEAD~3

git gc

git push --force

1 week ago
DarkShadow4444

Still doesn't delete the history - reflog will be kept. Unless you manually expire it.

1 week ago
VEryFatfellow OP

I am now let go from my toxic bank dev job, thanks to you.

1 week ago
ColaEuphoria
:c::cp::py::asm::rust:

git rebase -i --root

<delete random `pick` lines near the beginning of time>

git gc

git push --force origin master

1 week ago
SVlad_667

    git reset --hard ORIG_HEAD

1 week ago
Minimum_Session_4039

Did this the other day, was at the point where I just wanted to start over from scratch haha

1 week ago
WhyTheOverlyLongName

Just commit your .git directory in git. #shittylifehacks

1 week ago
RockVirtual6208

copy your entire repo on a backup hard drive smh. 3-2-1 rule people!

1 week ago
usrlibshare

reflog says hi

1 week ago
0xlostincode

rm -rf .git

would be more catastrophic

1 week ago
ChalkyChalkson

How about randomly changing history and pushing?

1 week ago
IuseArchbtw97543
:c::bash::j:

kid named backups

1 week ago
Striking-Jaguar-9993
:js:

All seniors in comment section ⭐⭐⭐⭐⭐

1 week ago
8threads

git push -f

1 week ago
ramriot

// # Les carottes sont cuites

1 week ago
Shekowaffle

Putting toothpaste back in is not that difficult

1 week ago
Apprehensive-Ad2615

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.

1 week ago
Sibula97

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.

1 week ago
Apprehensive-Ad2615

knowledge, I have forgotten that no everyone pushes as soon as the commit is done

1 week ago
No_Adhesiveness_3550
:py::powershell:

So no head?

1 week ago
pinktieoptional

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.

1 week ago
kaloschroma
:cp::js::hsk::j::lua::py:

Confused. I didn't know about any other git commands to undo like i learned in the comments but you can easily make as many branches as you would like so you always have copy before you git reset...

I often do risky moves in other branches if I don't trust the turnout (or my self lol)

6 days ago
Childish_fancyFishy

git clone someurl.com . .

Enter username Enter password .

Error : Unauthorized

6 days ago
kukurbesi

meirl

project 1 - final.zip

project 1 - final-1.zip

project 1 - final-2.zip

6 days ago
Xaxxus
:sw:

git reflog is your friend.

4 days ago
moroz_dev

Just use jj instead of git

1 week ago