Why is the wrong version always the one that is posted.
The (in my eyes) correct (and iirc original) version is:
Git commit
Git push
Get out*
*as someone pointed out (and I remember it as well, but thought I rembered it wrong and corrected it, shame on me in this context) the last point may be originally "git out"
I remember creating an alias for “git out” which worked like teamware or meecurial’s “out” (outgoing) command to show you what you would be pushing to a branch.
Here at Company Inc, we continue to send our thoughts and prayers to the 38 interns who perished in the office fire of '07. Sixteen years later, we still mourn the loss caused by this unpredictable, unpreventable, and unlitigatable accident. We hope that, in time, the grieving families of those interns are eventually able to move on with both their hearts and their loved ones' funeral expense debts.
Right, on shared branch you might need to pull first if you're out of date (and you would be if you're all leaving the office at the same time), and that could cause a merge conflict.
It's like I always said, bad branching strategies are a fire safety issue.
i read a reddit post years ago where a someone wrote a script that iterates through all the projects in their dev folder, for each project creating a new branch, committing and pushing.
they then aliased it to "fire" or "panic" or something like that.
Counterpoint: Virtualized environment/remote desktop. The real computer is in a data center hundreds of kilometers away with world class fire suppression systems.
Counter counterpoint: If you're virtualized you might be working from home, in which case, that's rough, hope they manage to restore your house.
With a laggy desktop experience i also can't really configure how i want? No thank you. It's bad enough i have to use Windows for software development instead of letting me install Linux
I like it because I don't have any of the company's shit on my own machine. I absolutely don't trust them not to spy on my personal computer use if they had access to it. With remote desktop I close it at the end of the work say and it has no more access to my computer than I have access to their critical systems.
In my case, their shit that we're required to use don't even support Linux so if it wasn't for virtualized environment I'd had to install Windows on my own machine.
This is a lawsuit waiting to happen. Anyway any of you ever heard of ACID? Why aren't our undo buffers durable and integrated with version control? Squash and forget the individual keystrokes as soon as an actual commit is made.
If the flames are nearby I would be so reckless and execute git push --force.
I don't want to die for a merge conflict.
But maybe then the team will burn me later.
Merging conflicts will be an issue no matter what you're working on. Maintaining different sets of code bases based on the version/release will be an issue even when working alone.
Situation: You're building some software to display emojis based on user input.
Current code: when user types "happy", output 🙂
Your new requirement: when user types "happy", output 😃 instead of 🙂
Coworker's new requirement: when user types "sad", output 😭
You implement your change, back it up, and the new version with 😀 is released. But it turns out 😃 is the ultimate insult in the Snowflake region, and you need to immediately rollback 😃 back to 🙂 while you find an alternative.
Meanwhile, Coworker has added 😭 to your backup, which still has 😃. Now when you try to rollback to 🙂, Coworker's code gets erased. Now your code is unable to safely support both 😭 with 🙂 without starting over entirely. Maybe you want to disable 😀 only for the Snowflake region, but that's not possible either without harding coding the regions instead of just changing the deployment.
Now imagine working with a team of 10 people, or a company with 100 people working on this same software. With features and release dates constantly changing.
I would agree with more people these tools become more needed, but I am talking about a solo dev situation who is the only person who accesses the code base. All other contributors I carefully import.
That doesnt sound like a good reason. What other reasons could you possibly have to do copypasta backups over what you can at least use as a diff based backup letting you still access any old version you want
I just find frequent full backups give me more control and less surprises when I find out my code did not sync/commit or some other issue. Done it for 3 years and it has been very worthwhile. Saved my project from a loss so many times now.
Me burning to death fixing pylint warnings before I can commit my code.
Melting because someone didn't configure the right profile and now isort and black are fighting over imports.
Why is the wrong version always the one that is posted.
The (in my eyes) correct (and iirc original) version is:
*as someone pointed out (and I remember it as well, but thought I rembered it wrong and corrected it, shame on me in this context) the last point may be originally "git out"
It is
Honestly I remebered it as "git out" as well, but that would be semantically incorrect and "get out" seems close enough.
Here
git outis mentionedThat is so much better 👍
I remember creating an alias for “git out” which worked like teamware or meecurial’s “out” (outgoing) command to show you what you would be pushing to a branch.
Merge conflict
Here at Company Inc, we continue to send our thoughts and prayers to the 38 interns who perished in the office fire of '07. Sixteen years later, we still mourn the loss caused by this unpredictable, unpreventable, and unlitigatable accident. We hope that, in time, the grieving families of those interns are eventually able to move on with both their hearts and their loved ones' funeral expense debts.
Should've pulled first before starting your work.
Sometimes my work takes a while and other people push in the meantime. Guess I'm dying the fire.
Then you pull before committing.
Boom, merge conflict. The only thing left to me is force push and delete everyone's changes.
Eh, it's probably fine. Those chumps don't do anything useful.
On a push? What are you merging there?
Ofc, you might be working directly on develop/master/shared branch, I know people that work in those environments (ew)
Right, on shared branch you might need to pull first if you're out of date (and you would be if you're all leaving the office at the same time), and that could cause a merge conflict.
It's like I always said, bad branching strategies are a fire safety issue.
i read a reddit post years ago where a someone wrote a script that iterates through all the projects in their dev folder, for each project creating a new branch, committing and pushing.
they then aliased it to "fire" or "panic" or something like that.
not a bad idea really
git-fire
As in one they'd manually run if there was a fire?
Exactly. The alias just points to the script which is executed.
Ohh I see so you just run git fire?
if its aliased you should be able to just run "fire" and it does the rest
Oh bash alias right
Slight correction. In case of fire:
Git checkout -b firemyusername Git commit -am="fire" Git push.
We don't want to have conflicts with code versions when going in on a rush, better to create a new branch. We can merge all the conflicts afterwards.
Isn't that what git stash is for though?
Can't push a stash
git push origin refs/stash@{$n}:stash/$USER/$niircCan't you? Could've sworn you could
I've done it with TFS source control at least, thought it would be possible with git
Oh man I hadn't seen a
git checkout -bin years haha since they introducedswitchandrestore, never looked backI'll admit I just press the buttons in my favourite IDE and had to look up the commands to remind myself, but yeah.
Gonna need some semicolons or double ampersand in there
Nah, what I need is doble new lines of code blocks since this is markdown and it fucked the display.
Here you go:
I know how to do it, I was just lazy lmao.
Cause of death: 15 minute long pre-push hook
Just
git add . && git commit -m "sorry theres a fire" && git push -u origin feature/fireAnd run out. It will eventually finish pushing. Or not.
git add .; git commit -nm fire --no-gpgsign; git push -n origin fire/${USER}In case of
Git commit
Git push origin main --force
Fire
*git out
*git -tf out
git fire
"I followed the rules, Boss. Not my fault the rules are stupid 🤷♂️"
You could change it to
git commit .to add and commit everything. But just in case you weren't up to date, you should probably doFor maximum chaos.
Counterpoint: Virtualized environment/remote desktop. The real computer is in a data center hundreds of kilometers away with world class fire suppression systems.
Counter counterpoint: If you're virtualized you might be working from home, in which case, that's rough, hope they manage to restore your house.
With a laggy desktop experience i also can't really configure how i want? No thank you. It's bad enough i have to use Windows for software development instead of letting me install Linux
I like it because I don't have any of the company's shit on my own machine. I absolutely don't trust them not to spy on my personal computer use if they had access to it. With remote desktop I close it at the end of the work say and it has no more access to my computer than I have access to their critical systems.
In my case, their shit that we're required to use don't even support Linux so if it wasn't for virtualized environment I'd had to install Windows on my own machine.
Fair, good point. I guess i'm lucky that i don't have to use my own devices, my machine is provided by my employer.
Mark this shit NSFW. I could have viewed it at work.
And if your git repo is self-hosted on-prem, you'd better be helping pack it and carry it out.
no changes added to commit (use "git add" and/or "git commit -a")
It should (at least) be:
Better, create a new branch and push it to origin(?).
Relevant The IT Crowd
Better have not created any new files tho - git commit -a doesn't catch those without an add first.
So we need
git add .&&git commit -ahere reallyIn which case the -a isn't needed.
This is a lawsuit waiting to happen. Anyway any of you ever heard of ACID? Why aren't our undo buffers durable and integrated with version control? Squash and forget the individual keystrokes as soon as an actual commit is made.
I've got something similar on my office door that reads
In case of fire git commit -a git push git -tf out
First, git checkout -b omgFire, then do the rest.
Sorry to be that guy but I don't think it's smart to put this anywhere in public, keep this shit somewhere private as a joke
If the flames are nearby I would be so reckless and execute git push --force.
I don't want to die for a merge conflict.
But maybe then the team will burn me later.
Just push to a new branch
Another reason I just manually backup my project and avoid Git despite all my other developer friends shaming me. One command and I am out of there.
That doesn't hold up so well when you work with other people on a project.
Yes and no depending on what you are working on.
Merging conflicts will be an issue no matter what you're working on. Maintaining different sets of code bases based on the version/release will be an issue even when working alone.
Can you describe a situation that underscores this issue as I am not seeing it, but maybe I experience it and do not even realize.
Situation: You're building some software to display emojis based on user input.
Current code: when user types "happy", output 🙂
You implement your change, back it up, and the new version with 😀 is released. But it turns out 😃 is the ultimate insult in the Snowflake region, and you need to immediately rollback 😃 back to 🙂 while you find an alternative.
Meanwhile, Coworker has added 😭 to your backup, which still has 😃. Now when you try to rollback to 🙂, Coworker's code gets erased. Now your code is unable to safely support both 😭 with 🙂 without starting over entirely. Maybe you want to disable 😀 only for the Snowflake region, but that's not possible either without harding coding the regions instead of just changing the deployment.
Now imagine working with a team of 10 people, or a company with 100 people working on this same software. With features and release dates constantly changing.
I would agree with more people these tools become more needed, but I am talking about a solo dev situation who is the only person who accesses the code base. All other contributors I carefully import.
That doesnt sound like a good reason. What other reasons could you possibly have to do copypasta backups over what you can at least use as a diff based backup letting you still access any old version you want
I just find frequent full backups give me more control and less surprises when I find out my code did not sync/commit or some other issue. Done it for 3 years and it has been very worthwhile. Saved my project from a loss so many times now.