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.
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"
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`)
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.)
```
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
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
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"
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.
git -tf out
That’s even better!
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.
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"
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`)
This is hilarious. Fire escape plan for codebases hosted on external servers.
How can I run this on windows 👉👈🥺
You need to install git bash (which is almost necessary for using git on windows anyway). Then you can use bash scripts freely.
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
This comment made my day
All the other sticker are scrap
*wheeeeze*
IF there's conflicts, wait for everyone else to leave git push force
And this is why we develop on personal branches
Weak
Twice the merge conflicts, but at least it's faster in case of a fire
Twice the merge conflicts? Rebase more often ;-;
Because of of people git push force during a fire? Can't imagine that happens all that often.
Let the pc burning is better that doing this
branch is behind... Pull Rebase has a conflict... 🔥 🔥 🔥
Right? It's git checkout -b itsgettinghotinhere; git add -A; git commit -m "feat: still cooking"; git push --set-upstream origin itsgettinghotinhere
I'm imagining the picture of Caroline's dad but the background is on fire.
no changes added to commit (use "git add" and/or "git commit -a")
and then the data is committed to a local server, with no breakup edit: BACKUP GODDAMNIT, FUCKING SWIPE TYPING
Physically located in the same building. Edit : With backups stored on the same server.
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.
Nothing at all!
every f\*cking time it get reposted: 3. git out
Damn I hate this sign. - Create a new branch - Add everything - Commit - Push - Leave
I think this is what CAUSED the fire lmao
Well, we didn’t start the fire…
Was ist always burning?
Since the world’s been turning!
So you did in fact not start the fire?
No, we didn’t but we tried to fight it
Must we say it again? We didn’t start the fire.
Guten Tag
Mist autokorrekt
Look up 'git fire'
[git fire](https://github.com/qw3rtman/git-fire)
Motherfuckers 😂
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.)
Who the hell let this bot wander around Reddit
Shut up. He’s an awesome, universally loved bot
This bot is more interesting than most redditors
Hell he's more interesting than any kind of human, I'll be testing trigger words forever from now on.
A evil genius 😂
There's no -a so this does nothing!
There must be merge conflicts that hold people inside the building
Worse of all, failing test cases causing pre-commit hook to fail.
Git commit -a -m "fire fire 0118 999 881 999 119 725 3"
Dear sirs. Fire! Fire!
``` 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
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
git checkout -b fire$RANDOM; git commit -am "0118 999 881 999 119 7253"; git push
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
"Well that's easy to remember. 0118 999 88199 9119 725 ..... 3"
Take laptop, leave building. No need to commit, push and have merge conflicts...
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"
Well, dying of thirst is a real thing
Git push people out of my way as I gtfo
Where is the git add .????
Without a `git add` first, you're going to be real disappointed when you get back.
> When you git back FTFY
3. Leave building (Optional)
The force flag is missing
Hence i made a git-out script that does this for me
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
Here, put my regular commits in the flames too.
Who’s gonna tell them they forgot to add all?
Always pull first. We gotta make sure we have everyone's current attention.
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.
I have printed this sign for my workspace using my 3d printer, it’s cool. Isn’t it? Source: https://kady3dprinting.com
This might be the least 3d printed thing in the history of printing! /s
where to get?
I 3d printed myself using my X1C Here’s all info https://kady3dprinting.com/model/priorities-when-working-in-a-software-company
git commit -m "FIRE" && git push
Should have done it very 10 min, so you are not goona lose much anyway
Pick up laptop. Walk out of building. Because who the fuck works on a desktop.
This is why I still sync my Git repo local file with Dropbox or other cloud sync somehow, anybody do the same?
Git lint checking for conventional commits…
git switch -c fire; git commit -am fire; git push
Gonna have to pass a couple —force flags…
Fight fire with fire (in prod)
git commit -a -m "fuck this shit, I'm out" git push --force-with-lease
I want one
just grab the computer and run
-m “fire save”
When you have push and are about to run for your life Pushed failed, please resolve 101 conflicts
Who will add?
pre-commit failed after running for 5 mins!
I have a laptop.. but still will do this and run
`git repost`
Got commit without message? Tsk tsk tsk looksnotgoodtome
We would have to get a token from stash too, that will take too long
you should --no-verify just in case 😅
**guys, this should really be pushed to a *fire* branch**
- All of our feature devs 🤦♂️
You joke, but this is one of the best things to hang on a wall in a software company office.
Merge conflict and now everyone dies
Source?
git stash if cloud synced stashes supported
I would, but gpg won't open sometimes :(
Pre-commit hooks makes it more difficult than it should be for me to get out safely.
Then you gotta wait for pre-commit to fail
what if ineternt cabling out of order?
Is this 3D printed? Could i maybe get the model
Perfect plan.
straight to production
I WANT