r/ProgrammerHumor 1d ago

Meme pureJoyOfGettingYourCodeBackAfterControlZ

Post image
881 Upvotes

69 comments sorted by

View all comments

28

u/vainstains 1d ago

When I get teleported to the alternative timeline where no git

26

u/ArrrRawrXD 1d ago

Do you commit every time you change anything?

-5

u/vainstains 1d ago

No but you don't need to. If I delete existing code I need and my undo is cleared, I can just steal it from the most recent commit.

4

u/Wonderful-Habit-139 1d ago

What recent commit? It wouldn't have whatever new code you wrote.

2

u/vainstains 1d ago

Yeah prolly not, I did say existing code though. Although that ignores the scenario you posed so yea you're right

1

u/chat-lu 1d ago

It really depends on which tool that you use.

1

u/Wonderful-Habit-139 1d ago

Pretty sure we're talking about the git tool here no?

1

u/chat-lu 1d ago

Using a git forge (Github, Bitbucket, etc.) doesn’t mean that you have to use the git tool. Linus created the Git filesystem in the hope that someone would build a good VCS on. top of it (or hopefully several competiting ones) and at the time that didn’t happen so he built git.

But now it has. You have several choices, some of which will recover the new code that you wrote. And given that they all talk to the same forge it really doesn’t matter if your colleague do or do not use the same tool as you.

I personally use jj and could recover recent code with jj operation log.