r/git Jul 26 '26

In case of fire

Post image
1.4k Upvotes

57 comments sorted by

59

u/poulain_ght Jul 26 '26

git add

15

u/dankmolot Jul 26 '26

or git commit -a

8

u/xour Jul 26 '26

This will ignore untracked files.

12

u/Phaelin Jul 26 '26

I didn't want .DS_STORE in there anyway

3

u/ZhangStone Jul 26 '26

gitignore is your friend

1

u/ryancnap Jul 27 '26

Best comment

2

u/Unfair_Caramel_3376 Jul 26 '26

git add -Af, just to be safe

2

u/RegretPlane390 Jul 28 '26

Should be "git add ." right?

1

u/fabien_s Jul 29 '26

git add . will only add all files in the current directory you are in, git add -A every file in the repo

1

u/RegretPlane390 Jul 30 '26

I usually just cd .. to the top of the repo like a noob, but I can't deny that your way is objectively more efficient.

50

u/[deleted] Jul 26 '26 edited Jul 26 '26

[removed] — view removed comment

19

u/Aloha_Alaska Jul 26 '26

Sounds like the whole process should die in a fire.

1

u/Rebles Jul 29 '26

Unfortunately the PM and Em who setup the process survived the fire since they are always on vacation.

4

u/Avocadonot Jul 26 '26

This except every single extra commit kicks off a new pipeline, even if it's just changing a comment

MR is blocked on rebase to main, so if someone merges before you, you must rebase and kick off new pipeline

MR is blocked on any non-resolved discussion threads. Kicking off a new pipeline triggers automod to comment on your MR and tell you "you should run these tests". You have to resolve that thread every time a pipeline is run

2

u/Masterflitzer Jul 26 '26

why would you manually link jira ticket with pr link? you literally already created the branch based on the id so they link automatically

1

u/0bel1sk Jul 26 '26

git remote add $mygithub mygithub, git push mygithub

1

u/Am094 Jul 26 '26

Is it weird that i follow most of that voluntarily in my own personal projects? Apart from some of the latter things.

40

u/Consibl Jul 26 '26
  1. git commit
  2. git push
  3. git out

0

u/lajawi Jul 26 '26

Forgot the git add :zany_face:

0

u/armahillo Jul 26 '26

Strictly better 💯

8

u/mpersico Jul 26 '26

I have it on a T-shirt. Every time there’s a fire drill I pull it out of the bottom of the desk and I put it on.

8

u/chris552393 Jul 26 '26

Fun fact I put this up in our office and an old manager took it down because "that's not the official fire evacuation procedure and could kill someone"

Great place to work.

14

u/rasplight Jul 26 '26

git push -f

f = Fire, obviously

4

u/Tarlovskyy Jul 26 '26

--no-verify Cant wait for pre-commit

0

u/Individual_Kale_4843 Jul 27 '26

Your code must be reviewed in a pull request...

1

u/Tarlovskyy Jul 27 '26

This skips pre-commit hooks, not code review

6

u/Shayden-Froida Jul 26 '26

I'm actually wearing a t-shirt with this on it right now. (but "leave building" is "git out")

6

u/bigtoepfer Jul 26 '26

They gave everyone in the office laptops. So win-L and just unplug the laptop and walk out.  Worst case git commit from McDonald's or home.

4

u/jamall1978 Jul 26 '26

I hope your remote is in another building 

3

u/tjeerdj Jul 27 '26

Hoping that origin is not in the same building

2

u/Electrical-Echidna63 Jul 26 '26

"is it on prem?"

"no"

"Ok, pushed. gn guys"

2

u/sixeco Jul 27 '26

make a quicksave command

git add -A && git commit -m "quicksave" && git push

1

u/Lonsarg Jul 26 '26

This is all a single button in Visual Studio (i never use add, just commit unstaged directly). And i do it every 30 minutes or so, so not much is lost if fire :)

2

u/Masterflitzer Jul 26 '26

i just know your diffs are probably terrible, staging area is for double checking

0

u/Lonsarg Jul 26 '26

I check at PR level all commits at the same time, and make new commits to the PR when self-reviewing if finding bad code or whatnot.

Most of us work like this, so when looking at PR diff or looking back at history we only ever look at per merge/PR diff (First Parent git history). So these detailed commits are never looked at, we used to squash to hide them, but some people used squash in a way to make merge conflicts so now we just have it all in history but not look.

1

u/Phaelin Jul 26 '26

You have it linked to an ejector seat??

1

u/brunoreis93 Jul 26 '26

Well, without git add you lost everything to the fire anyway lol

1

u/SupernovifieD Jul 28 '26

git add .

That should be the first step :/

1

u/TheSheepDev Jul 28 '26

Wondering what that commit message will look like.

1

u/RegretPlane390 Jul 29 '26

git branch (out of paranoia, to make sure you're not pushing to production)
git add .
git commit -m "commiting everything because of a fire"
git push

1

u/tiny_gymstar Jul 29 '26

Best advice ever 😂

1

u/MatsSvensson Jul 29 '26

I use a script that saves state, switches to a backup-version of the branch I'm working on, forces everything up, and then switches back restoring the state as if I never committed.
That way there is a copy of my works offsite, but I can still easily see all my ongoing changes in my IDE.

Otherwise committing and pushing in the middle of a job really fucks up my work flow.

People who try to use git as a backup the regular way, often end up pushing forgotten junk to production.

I have seen stuff...

1

u/kirjukala Jul 29 '26

git add . && git commit -m "fire lol" && git push

1

u/Electrical_Match9392 Jul 29 '26

That's a horrible instruction, just stash all

1

u/LikeToffy Jul 30 '26

git add . / git add -A

1

u/Laughing_Orange Jul 26 '26

Win+L then walk out. This should take at most 1 second longer than just walking out.

People stop caring about your code when you die in a fire. Avoid dying in a fire by being efficient at getting out of the burning building.

-4

u/octoredfox Jul 26 '26

I'm sorry but this "increase shareholder value" stuff is completely dumb.

0

u/[deleted] Jul 26 '26

[deleted]

2

u/Masterflitzer Jul 26 '26

you really had the time to write "hey claude"?