DEV Community

🔥 In case of fire: GTFO

Stephen Chiang on April 20, 2019

Intro Hopefully this will never happen to you, but even if it's not a fire or earthquake, an emergency may arise and you are pressed to ...
Collapse
 
andmoredev profile image
Andres Moreno •

I love the idea and it is something you can easily remember since the command relates to what you actually have to do => GTFO.
Fortunately I have never had a scenario where I really lost my work, usually it has been small things or a fire drill.

Collapse
 
somedood profile image
Basti Ortiz •

This is definitely the funniest thing I've read today. 🤣

Collapse
 
sleepyfran profile image
Fran González •

Honestly if anyone finds themselves in a situation in which the branch already exists maybe they should consider switching companies instead of removing the existing branch! Great article, hope I never have to use it 😂

Collapse
 
chiangs profile image
Stephen Chiang •

Haha or maybe recommend the company to change buildings!

Collapse
 
qcgm1978 profile image
Youth •

Why does the working command is

tfo = !git checkout -b emergency-exit && git add . && git commit -m 'Emergency exit' && git push origin head -u

and it renames my current branch? My notebook is mac.

Collapse
 
chiangs profile image
Stephen Chiang •

Are you sure it renamed your branch or just switched you to the new branch? Check your list of branches.

No where in the function does it say:

> git branch -m emergency-exit

The above is what it would take to rename a branch locally.

Collapse
 
emilienmottet profile image
Emilien Mottet •

Maybe

git add -A

should be more efficient than

git add .

. In case, you are not into the root of your git repo

Collapse
 
chiangs profile image
Stephen Chiang •

Good idea, I'll update that, thanks!

Collapse
 
matthewpersico profile image
Matthew O. Persico •

I've got that t-shirt that says something like this. I pull it on for every fire drill in my office. Maybe I need to make my own with this command instead. LOL

Collapse
 
chiangs profile image
Stephen Chiang • • Edited

I'd buy that shirt... Maybe @thepracticaldev would make one!

Oh oh here's an idea... Dev should make shirts from meme-able posts and have the post url on the shirt somewhere...

Collapse
 
matthewpersico profile image
Matthew O. Persico •

The shirt should have the QR code of the meme. That way instant gratification.

Collapse
 
jericomanapsal profile image
jericomanapsal •

This truly is an excellent post! Although I'm constantly hoping that accidents don't happen, it does eventually. Thank you for sharing this! 🎉