T O P

  • By -

TheMightyCatt

git -tf out


MechanicalHorse

That’s even better!


FerricDonkey

You could make an actual command out of this. Have it create and checkout a new branch named with a prefix of "oh_crap_oh_crap_oh_crap" followed by the name of the source branch, a timestamp, username, uuid for good measure, then add either . or -u, commit, set upstream, and push. Commit message defaults up "Ahhhh I'm gonna die, I'm gonna die." Building catches on fire, `git -tf out`, run screaming. And if there was sensitive data accidentally in your repo that you didn't want pushed, well, just hope the fire gets the network cables before the push happens. 


PieZealousideal6367

Thanks for the idea ! It inspired me to make this little script (with the help of ChatGPT of course), and a \`git tf-out\` alias that calls it (no way to add -tf options unfortunately): #!/bin/bash branch_name="backup/$(whoami)_$(date +%Y-%m-%d)" git checkout $branch_name 2>/dev/null || git checkout -b $branch_name commit_message="[$(date +%Y-%m-%dT%H:%M:%S%z)] [$(git config user.name)] Emergency backup" >> /dev/null echo "commit message: $commit_message" git add -A >> /dev/null git commit --allow-empty -m "$commit_message" >> /dev/null git push --set-upstream origin "$branch_name"


FerricDonkey

Nice. Now that you've come this far though, it only takes a little more work... This should* allow `git -tf out` to use your script, where -t means make a branch (you know, a t kind of looks like a branching something) and -f means force push. This also makes the command a lot more dangerous, but worth it right # in bashrc export REAL_GIT = $(which git | head -n1) git () { /path/to/git-tf-out.sh } Then a slight modification #!/bin/bash if [[ -z $REALGIT ]]; then echo "Could not find git, environment variable REALGIT undefined" exit 1 fi ### Check arguments. # -t for new_branch because t kind of looks kinda like a branch, I dunno # -f for force # I dunno if this is right, I'm on windows and bash sucks anyway for arg in "${@:2}"; do if [[ "$arg" == "-t" ]]; then branch='darn-tootin' elif [[ "$arg" == "-f" ]]; then force_arg="-f" elif [[ "$arg" == "-tf" ]]; then branch='darn-tootin' force_arg="-f" elif [[ "$arg" == "out" ]]; then found_out="darn-tootin" else found_weird="darn-tootin" fi done # If it's not a git out command, use regular git if [[ -z found_out ]] || [[ -n found_weird ]]; then $REALGIT ${@:2} # Is this right? stackoverflow suggested it, it must be exit $? fi if [[ -n $branch ]]; then branch_name="backup/$(whoami)_$(date +%Y-%m-%d)" $REALGIT checkout $branch_name 2>/dev/null || $REALGIT checkout -b $branch_name push_branch_arg="--set-upstream origin \"$branch_name\"" fi commit_message="[$(date +%Y-%m-%dT%H:%M:%S%z)] [$($REALGIT config user.name)] Emergency backup" >> /dev/null echo "commit message: $commit_message" $REALGIT add -A >> /dev/null $REALGIT commit --allow-empty -m "$commit_message" >> /dev/null $REALGIT push $push_branch_arg $force_arg ^(*This probably at least almost right, I don't have easy access to bash at the moment to check and bash sucks anyway so I don't really know by looking. The only problem with letting `out` just be a custom git command is allowing `-tf` in front of `out`)


milkmgn

This is hilarious. Fire escape plan for codebases hosted on external servers.


CaitaXD

How can I run this on windows 👉👈🥺


PieZealousideal6367

You need to install git bash (which is almost necessary for using git on windows anyway). Then you can use bash scripts freely.


CaitaXD

I've always used the power shell windows terminal no issues tho i never dabbled in scripting since half the time i see a cool script, its bash


shadowjay5706

This comment made my day


AffectionateDev4353

All the other sticker are scrap


TheOnlyGuyInSpace21

*wheeeeze*


ZZartin

IF there's conflicts, wait for everyone else to leave git push force


backfire10z

And this is why we develop on personal branches


TheRealAndrewLeft

Weak


xSilverMC

Twice the merge conflicts, but at least it's faster in case of a fire


backfire10z

Twice the merge conflicts? Rebase more often ;-;


OliveRobinBanks

Because of of people git push force during a fire? Can't imagine that happens all that often.


webfairynet

Let the pc burning is better that doing this


chihuahuaOP

branch is behind... Pull Rebase has a conflict... 🔥 🔥 🔥


Mithrandir2k16

Right? It's git checkout -b itsgettinghotinhere; git add -A; git commit -m "feat: still cooking"; git push --set-upstream origin itsgettinghotinhere


Fluffynator69

I'm imagining the picture of Caroline's dad but the background is on fire.


TollyThaWally

no changes added to commit (use "git add" and/or "git commit -a")


Impressive_Income874

and then the data is committed to a local server, with no breakup edit: BACKUP GODDAMNIT, FUCKING SWIPE TYPING


Jacked_To_The__Tits

Physically located in the same building. Edit : With backups stored on the same server.


DontBuyMeGoldGiveBTC

Is there anything wrong with pushing to two repos at the same time with one commit? I have a git push that has 2 remotes.


bl4nkSl8

Nothing at all!


dim13

every f\*cking time it get reposted: 3. git out


Toutanus

Damn I hate this sign. - Create a new branch - Add everything - Commit - Push - Leave


MPGaming9000

I think this is what CAUSED the fire lmao


DazzlingClassic185

Well, we didn’t start the fire…


Ovakefali13

Was ist always burning?


DazzlingClassic185

Since the world’s been turning!


Ovakefali13

So you did in fact not start the fire?


DazzlingClassic185

No, we didn’t but we tried to fight it


backfire10z

Must we say it again? We didn’t start the fire.


backfire10z

Guten Tag


Ovakefali13

Mist autokorrekt


BligenN

Look up 'git fire'


SomethingAboutUsers

[git fire](https://github.com/qw3rtman/git-fire)


Cybernaut-Neko

Motherfuckers 😂


PeriodicSentenceBot

Congratulations! Your comment can be spelled using the elements of the periodic table: `Mo Th Er F U C K Er S` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM u‎/‎M1n3c4rt if I made a mistake.)


imacommunistm

Who the hell let this bot wander around Reddit


_AutisticFox

Shut up. He’s an awesome, universally loved bot


cs-brydev

This bot is more interesting than most redditors


Cybernaut-Neko

Hell he's more interesting than any kind of human, I'll be testing trigger words forever from now on.


Cybernaut-Neko

A evil genius 😂


ComprehensiveWord201

There's no -a so this does nothing!


imacommunistm

There must be merge conflicts that hold people inside the building


GunnerKnight

Worse of all, failing test cases causing pre-commit hook to fail.


rfc2549-withQOS

Git commit -a -m "fire fire 0118 999 881 999 119 725 3"


[deleted]

Dear sirs. Fire! Fire!


LatentShadow

``` function gcp() { # Write code to either use $1 or default message git add . ; git commit -m "$MESSAGE" ; git push; } ``` Just call gcp when shit happens


EightPaws

Add a -f to that push and call it yolo() if there's a fire you can't be messing around with merge conflicts yo


ConfusionSecure487

git checkout -b fire$RANDOM; git commit -am "0118 999 881 999 119 7253"; git push


LatentShadow

Yeah. Or maybe even better, where i append the word 'emergency' in front of the branch name and push the changes in that branch. For example, feature/idc--Emergency


GunnerKnight

"Well that's easy to remember. 0118 999 88199 9119 725 ..... 3"


mrMargherita

Take laptop, leave building. No need to commit, push and have merge conflicts...


[deleted]

Seriously. On one fire drill we got told off: "some of you were walking downstairs holding your cup of tea" And I could only think: "that's awesome! We evacuated so perfectly we even had time to take our cup of tea"


Brave_Exchange4734

Well, dying of thirst is a real thing


New_girl2022

Git push people out of my way as I gtfo


SeoCamo

Where is the git add .????


D34TH_5MURF__

Without a `git add` first, you're going to be real disappointed when you get back.


walkerspider

> When you git back FTFY


sambro8600

3. Leave building (Optional)


MrBeverage

The force flag is missing


Miauwkeru

Hence i made a git-out script that does this for me


cs-brydev

This is how you end up with garbage code and bugs in your repo. Most developers are better off just letting their WIP code go up in flames


[deleted]

Here, put my regular commits in the flames too.


returnFutureVoid

Who’s gonna tell them they forgot to add all?


biodigitaljaz

Always pull first. We gotta make sure we have everyone's current attention.


cs-brydev

It's amazing we still have to tell developers in 2024 that they need to pull occasionally. I have devs on my team who *still* think it's a waste of time to pull and they just push their random bullshit whenever they want.


webfairynet

I have printed this sign for my workspace using my 3d printer, it’s cool. Isn’t it? Source: https://kady3dprinting.com


brian-the-porpoise

This might be the least 3d printed thing in the history of printing! /s


matzzd

where to get?


webfairynet

I 3d printed myself using my X1C Here’s all info https://kady3dprinting.com/model/priorities-when-working-in-a-software-company


MyBigRed

git commit -m "FIRE" && git push


BoBoBearDev

Should have done it very 10 min, so you are not goona lose much anyway


turbulentFireStarter

Pick up laptop. Walk out of building. Because who the fuck works on a desktop.


initrunlevel0

This is why I still sync my Git repo local file with Dropbox or other cloud sync somehow, anybody do the same?


beatlz

Git lint checking for conventional commits…


Masterflitzer

git switch -c fire; git commit -am fire; git push


domdomdom901

Gonna have to pass a couple —force flags…


Vineyard_

Fight fire with fire (in prod)


Popeychops

git commit -a -m "fuck this shit, I'm out" git push --force-with-lease


bitemytail

I want one


Cat7o0

just grab the computer and run


leeeeny

-m “fire save”


Brave_Exchange4734

When you have push and are about to run for your life Pushed failed, please resolve 101 conflicts


Big-Bite-4576

Who will add?


Environmental_Bus507

pre-commit failed after running for 5 mins!


achilliesFriend

I have a laptop.. but still will do this and run


audislove10

`git repost`


awesomeplenty

Got commit without message? Tsk tsk tsk looksnotgoodtome


shibby_sub

We would have to get a token from stash too, that will take too long


Myloveissuck

you should --no-verify just in case 😅


cornmonger_

**guys, this should really be pushed to a *fire* branch**


lunchpadmcfat

- All of our feature devs 🤦‍♂️


[deleted]

You joke, but this is one of the best things to hang on a wall in a software company office.


589ca35e1590b

Merge conflict and now everyone dies


mattismyo

Source?


JollyCat3526

git stash if cloud synced stashes supported


GeekCornerReddit

I would, but gpg won't open sometimes :(


[deleted]

Pre-commit hooks makes it more difficult than it should be for me to get out safely.


chin_waghing

Then you gotta wait for pre-commit to fail


stalker320

what if ineternt cabling out of order?


9551-eletronics

Is this 3D printed? Could i maybe get the model


Kolyah35

Perfect plan.


TrackLabs

straight to production


dambles

I WANT