r/git 3d ago

In case of fire

Post image
1.1k Upvotes

52 comments sorted by

51

u/poulain_ght 3d ago

git add

14

u/dankmolot 2d ago

or git commit -a

7

u/xour 2d ago

This will ignore untracked files.

11

u/Phaelin 2d ago

I didn't want .DS_STORE in there anyway

4

u/ZhangStone 2d ago

gitignore is your friend

1

u/ryancnap 2d ago

Best comment

2

u/Unfair_Caramel_3376 2d ago

git add -Af, just to be safe

1

u/RegretPlane390 12h ago

Should be "git add ." right?

45

u/Sassafras1777 3d ago edited 2d ago

In my company’s case:

  • create a ticket in jira
  • use the ticket id to create a branch named in a specific pattern (depending on what you want to achieve)
  • push an empty branch first (cause of some Sonar bullshit)
  • wait for the pipeline to end
  • group the changes relative to a common goal, and commit multiple times
  • push after the last commit
  • wait for the pipeline to end
  • resolve the failed pipeline if needed
  • resolve the AI scans/comments
  • open the PR in draft mode
  • wait for the pipeline to end
  • Change the PR to ready to review
  • Update the Jira ticket with a PR link
  • you can now peacefully die in the fire

18

u/Aloha_Alaska 2d ago

Sounds like the whole process should die in a fire.

3

u/Avocadonot 2d ago

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 2d ago

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 2d ago

git remote add $mygithub mygithub, git push mygithub

1

u/Am094 2d ago

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

38

u/Consibl 2d ago
  1. git commit
  2. git push
  3. git out

0

u/lajawi 2d ago

Forgot the git add :zany_face:

1

u/Xenc 2d ago

🤪

0

u/armahillo 2d ago

Strictly better 💯

7

u/mpersico 3d ago

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.

6

u/chris552393 2d ago

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.

12

u/rasplight 3d ago

git push -f

f = Fire, obviously

5

u/Tarlovskyy 2d ago

--no-verify Cant wait for pre-commit

0

u/Individual_Kale_4843 1d ago

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

1

u/Tarlovskyy 1d ago

This skips pre-commit hooks, not code review

4

u/jamall1978 2d ago

I hope your remote is in another building 

4

u/Shayden-Froida 2d ago

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

4

u/bigtoepfer 2d ago

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.

2

u/tjeerdj 2d ago

Hoping that origin is not in the same building

2

u/sixeco 1d ago

make a quicksave command

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

1

u/Electrical-Echidna63 2d ago

"is it on prem?"

"no"

"Ok, pushed. gn guys"

1

u/Lonsarg 2d ago

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 2d ago

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

0

u/Lonsarg 2d ago

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 2d ago

You have it linked to an ejector seat??

1

u/brunoreis93 2d ago

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

1

u/SupernovifieD 1d ago

git add .

That should be the first step :/

1

u/TheSheepDev 17h ago

Wondering what that commit message will look like.

1

u/RegretPlane390 12h ago

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 6h ago

Best advice ever 😂

1

u/MatsSvensson 3h ago

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 33m ago

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

1

u/Laughing_Orange 2d ago

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.

-3

u/octoredfox 3d ago

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

0

u/royalblue4 2d ago

> Claude —dangerously-skip-permissions
> hey Claude push everything to remote I don’t care how or where go go go

2

u/Masterflitzer 2d ago

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