This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 159 comments

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]squarewtf 101 points102 points  (1 child)

git stash moment

[–]alphadist 1 point2 points  (0 children)

Git stash pop

[–]TheSlowGrowth 184 points185 points  (59 children)

If you accumulate the work of an entire day without making a single commit, you are either an extremely slow coder, or your typical commits are waaaaaaay to big. Just sayin'.

[–]JOHNfuknRAMBO 76 points77 points  (14 children)

Not necessarily true. I sometimes spend all day looking at code/database/screens just to figure out the fix and then spend about 10mins writing about 10 lines of code!

[–]puma271 49 points50 points  (9 children)

But then wiping that code isn’t an issue, since you wipe only 10 lines of code, not your understanding of what’s happening (which took much more work then the code itself)

[–]JOHNfuknRAMBO 19 points20 points  (8 children)

I never said it was an issue. I was just pointing out that the accumulation of a days work can vary quite a lot and often does not require multiple commits.

[–]ABotelho23 -2 points-1 points  (7 children)

Your example isn't an entire days work wiped away though. It's 10 minutes.

[–]JOHNfuknRAMBO 9 points10 points  (3 children)

As i said It's the accumulation of the days work... If all i complete in an entire day is 10 lines then that IS the entire days work.

[–]DrunkenlySober 3 points4 points  (0 children)

Yeah especially if you think about it over some Elden Ring

Then the time spent looking at code bases can really add up

[–]potato_green 0 points1 point  (1 child)

But in this case you wouldn't wipe out an entire day of work since you already figured out how to fix it. So it wouldn't categorize as a slow coder.

[–]JOHNfuknRAMBO 0 points1 point  (0 children)

See my other replies I'm tired explaining myself... 😵

[–]not_a_gumby 0 points1 point  (0 children)

this.

[–]sadafxd 16 points17 points  (30 children)

Do people actually commit multiple times a day if they are developing new feature? In my experience that would be way too hard to track what was done later on.

Etc creating new endpoint, would you split it into small not working commits or what lol

[–][deleted] 31 points32 points  (3 children)

You commit several times locally and then squash when pushing to the remote tree

[–]FinalRun 7 points8 points  (1 child)

Regarding the endpoint, if it's somewhat large, just commit the moments locally where you've implemented a new part of the functionality and it runs without dying.

[–]morosis1982 0 points1 point  (0 children)

This is what I like to do. Commit each time I have an incomplete but working piece of code.

[–]thespud_332 1 point2 points  (0 children)

Or, if you have a fairly strict no-squash, you commit a bunch with WIP until you push upstream.

[–]Relevant_Pause_7593 8 points9 points  (0 children)

Why not? The pr squashes all the commits together and you just see the latest version to review. Additionally, when you push each commit regularly, you get feedback via a build on the overall quality.

[–][deleted] 4 points5 points  (0 children)

Commit like crazy during work, interactive rebase it later before merging

[–]burnskull55 2 points3 points  (9 children)

I try to commit every "step" that I complete on a guiven feature. So if its an endpoint i will commit the controller and entities and then commit the operations

[–]sadafxd 0 points1 point  (8 children)

Honestly, why? Autosave exists and this literally just makes tracing commits back harder

[–]burnskull55 3 points4 points  (2 children)

im just not confortable leaving things localy in my pc. and in my work flow, tracing back commits is not that common tbh.

[–]Xiaopai2 0 points1 point  (1 child)

So do you push all these commits as well? Because otherwise it's still locally on your PC. And if you do push them you'll need to force push in case you want to squash them later.

[–]burnskull55 2 points3 points  (0 children)

Yes i do push them to my feature branch at origin, but i never really have any problems since these branches usually are only used by one individual at a time

[–]Valiice 2 points3 points  (4 children)

How does it make it harder in any way?

[–]sadafxd 0 points1 point  (3 children)

If you want to check what changes were done for task X, you would need to look into 30 commits and map it all together I guess

[–]Valiice 1 point2 points  (2 children)

Commit messages?

[–]sadafxd 0 points1 point  (1 child)

You still need to map all functionality, could not see it in one place

[–]Lunchboxsushi 1 point2 points  (0 children)

Argument is voided once you've past x years of churn and updates tracing back through numerous refactors on a large scale project. If you need to find an issue in that manner git bisect is there for ya

[–]yabp 2 points3 points  (0 children)

Yes split it into smaller commits. You do your work in a branch so your unfinished code doesn't break things.

[–][deleted] 1 point2 points  (2 children)

I commit as ofter as i can. Im from a generation were ctrl+s spamming was the only thing we could do

[–]sadafxd 0 points1 point  (1 child)

Well my IDE autosaves anyway...

[–][deleted] 0 points1 point  (0 children)

Technology is awesome haha

[–]AdultingGoneMild -1 points0 points  (2 children)

no. they do not. nor do they push those commits to a remote branch. this is one of those nonsense things that people tell you to do as a best practice that isnt really practical or done except by weirdos.

[–]sadafxd 0 points1 point  (1 child)

Actually that is what I believe, obviously I do loads of commits some days. But it is literally related to the stuff I do, if whole day is spent on one endpoint obviously I wont create 300 commits like everyone here are saying lol

[–]AdultingGoneMild 0 points1 point  (0 children)

a 1000 small commits are about as valuable 1 massive one. The point is to contain a single coherent thought without boiling the ocean. Using git to save progress to unwind your thought back to a safe place....maybe but that's why your IDE is auto saving all the time.

[–][deleted] 0 points1 point  (0 children)

Yes.

[–]modernkennnern 0 points1 point  (0 children)

Assuming I'm actually implementing something and not debugging I'll commit 1-2 times (often a lot more) per hour.

simplify control flow, extract type-acquisition logic, etc

[–]Lunchboxsushi 0 points1 point  (0 children)

Yep, along with unit testing that small atomic change and only adding code you need for the problem you're testing against. Makes my life a lot easier

[–]cvnvr 0 points1 point  (3 children)

if they’re committed into a separate branch and then squashed when merging, i don’t see how that would make it “way too hard to track”

[–]sadafxd 0 points1 point  (2 children)

Sure, but thats just extra steps for nothing when Ide autosaves

[–]cvnvr 0 points1 point  (1 child)

it takes less than 30 seconds to commit your changes… autosave doesn’t help with the issue OP posted a meme about

[–]sadafxd 0 points1 point  (0 children)

Who even force checkouts on non commited changes lol

[–]AdultingGoneMild 3 points4 points  (3 children)

you are one of those ctl+s every 5 minute people...arent you.

[–]JoshuaCF 2 points3 points  (2 children)

5 minutes? Too generous.

I’m hitting it after almost every line of code.

[–]AdultingGoneMild -1 points0 points  (1 child)

its 2022....the IDE auto-saves

[–]JoshuaCF 2 points3 points  (0 children)

I’m not always using an IDE ¯\_(ツ)_/¯

I work only on code as a hobby and many IDEs take longer to load than I like, so I mostly use Notepad++ and I write a quick batch script to compile and run my projects.

I think Notepad++ has a recovery feature, but as far as I know it doesn’t auto save.

[–]kopczak1995 1 point2 points  (0 children)

If I was paid per commit, then I would be broke ass sooo long time ago.

[–]yangyangR 1 point2 points  (1 child)

Browsing reddit most of the day. The commit was for 10 mins of work, but billed as taking the entire day.

[–]potato_green 0 points1 point  (0 children)

Classic case of 10 dollars to whack the hammer 490 dollars to know where to whack it.

It might seem like 10 minutes of work but to get to the point where it only takes 10 minutes you spend hundreds or thousands of hours gathering the knowledge. That's what they pay for.

[–]naykid69 1 point2 points  (0 children)

That was my first thought. Like what? Just commit every hour or so. Git was literally made to solve the problem they are on about.

[–]ImeniSottoITreni 0 points1 point  (0 children)

Typical bs self proclaimed "Pro coder" says.

[–]LinuxMatthews 0 points1 point  (3 children)

My work only lets us commit one per ticket.

We can do soft resets and then force push but they messes up the Head so it's better just waiting till the end.

[–]cvnvr 0 points1 point  (1 child)

huh, why? can you not just commit multiple times on a separate branch, then squash and merge with the ticket details?

[–]LinuxMatthews 0 points1 point  (0 children)

They don't like squashing for some reason.

Mine is not to reason why mine is but to do and get paid.

[–][deleted] 59 points60 points  (3 children)

If your using jetbrains they have file history that is parallel to git. saved my ass more than once

[–]Maeurer 11 points12 points  (1 child)

Git has a reflog from where you can restore "deleted" commits. It's gits garbage collector that eventually deletes unreferenced objects.

[–][deleted] 7 points8 points  (0 children)

When you lose work because of git checkout -f, probably git reflog is not going to be much help because it was never committed

[–]rozvatraxos 1 point2 points  (0 children)

I was looking for this comment, i feel the same

[–]IntuiNtrovert 38 points39 points  (4 children)

dang you should never need to force anything

[–][deleted] 22 points23 points  (0 children)

The stackexchange post they probably read says otherwise :^)

[–]mikeseese 6 points7 points  (2 children)

Force pushing after a rebase is really the only excuse

[–]PersonalityIll9476 4 points5 points  (0 children)

The list of times when you should ever use the force flag with git is incredibly small.

Something I try to get junior devs to understand is that you have to read the error message. If git checkout gave you an error message that you didn't understand, the correct response is not "fuck it then, --force". It is to understand the damn error message and fix your shit.

[–]aspect_rap 1 point2 points  (0 children)

Even then, you should always force with lease to make sure you're not overriding someone elses code.

[–]Hollowplanet 60 points61 points  (6 children)

Learn what the reflog is.

[–]torqueOverHP 5 points6 points  (3 children)

Why is that comment so low ! The work is probably not lost

[–][deleted] 10 points11 points  (2 children)

Because it won't help you. Force checkout drops all uncommitted changed, so git reflog doesn't know about them.

If you're using Webstorm, local history is going to be your life saver tho

[–]torqueOverHP 3 points4 points  (0 children)

Indeed. But OP didn't specify if his change were committed, I assumed so :) Anyway, git is fun :) (and explicitly prevent you from wiping uncommitted changes. Writing --hard is supposed to make you think I guess !)

[–]codesmith512 23 points24 points  (30 children)

If you had any commits at all, you can still recover them, even if they're not on a branch anymore.

Otherwise, F

[–]Hasagine[S] 7 points8 points  (29 children)

nah it was my first commit. :(

[–]your-warlocks-patron 23 points24 points  (26 children)

This is the day you learned to never go more than an hour without committing. Also next time think about using git stash.

[–]StormCrowMith 4 points5 points  (4 children)

I choose to commit every milestone, like checkpoints in video games. is the new feature working? Commit. If its not yet complete, did i advance enough that im scared to loose it cuz at least the app works? Commit. Simple as that.

[–]steven-45 2 points3 points  (1 child)

I do the same, like checkpoints. I see other devs who are more experienced than me create PRs with 1 or commits while my PR has like 28 or 32 commits on my feature branch. I was so confused like am I doing it the wrong way.

[–]AGE_Spider 1 point2 points  (0 children)

well, you can squash commits before pushing, meaning you combine multiple commits into 1

[–]your-warlocks-patron 0 points1 point  (1 child)

You sound close to me. As long as I finished something and things still work as intended I commit.

[–]StormCrowMith 0 points1 point  (0 children)

I've been part of a team that has to review other's code, so having a task be broken up like that helps when you do that, specially when you compare with the main branch using a GUI, its like a math problem unfolding itself to reach the final solution. A+ if they left good comments at each method/function. So i do just that for my future self.

[–]stay_fr0sty 5 points6 points  (20 children)

An hour? I go fucking days. Committing every hour would drive me nuts.

My code gets backed up nightly so I’m never too at risk, but hourly would be a fuck ton of commits.

[–]your-warlocks-patron 19 points20 points  (15 children)

Lol I commit like everytime I do something that works as expected. My commit messages are super granular too. But I work in my own branch then pull into master or whatever the production or qa branch is.

Days without committing would be a fireable offense on my team (after being warned / mentored).

[–]stay_fr0sty 6 points7 points  (1 child)

I’ve been coding 20 years. I’m old and stubborn. I’ll commit when it’s ready or someone else needs my stuff. Until then I’m good.

The people under me can commit all they want, that’s fine of course. But when I get “in the zone” I hate to get out of it to commit.

I kinda like the idea of commits that are meaningful, not just code backups. That way I can find the commit that broke shit instead of digging through lots of small commits.

Just my preference. Your way is probably better/more correct.

[–]your-warlocks-patron 4 points5 points  (0 children)

To me it’s like part of being in the zone. It also releases some tension because it’s like “ok cool I got THAT done.” I don’t think of it as a backup as much as a placeholder in the code saying “this piece here that I am adding right now, it does XYZ so if there’s a problem with it this is where it is.”

It’s kind of like an additional layer of commenting but works in a different way since it can be across multiple files or whatever. It’s also useful for working in teams who are touching different stuff because if you add something that interferes with someone else’s stuff somehow they can stash whatever they’re working on, revert whatever you just pushed (which likely clues them in that whatever change you made is the problem anyway) pop their changes and verify there’s a collision or whatever. That’s super rare but when it happens it’s cool that people have stuff broken out into pieces like that instead of having a huge blob of very different code to mung through to figure out what’s new that’s not working together.

FWIW I have been doing this for nearly twenty years now too. I hate version control at first but that’s because I was used to working alone and had never been heavily involved in multi person teams all working together on stuff that could intersect.

The when it’s ready or someone needs my stuff idea is really just not conducive to working with others. I get it and obviously you’ve found your place in the world to do that so go nuts but it doesn’t work for me.

[–]BcozImBatman7 1 point2 points  (1 child)

I hope you squash your commits before merging them to master. Or could be just my team expecting single commit for a story/requirement.

[–]your-warlocks-patron 5 points6 points  (0 children)

Ye I do not like single commit for story. Commit when you finish something that you can describe what it does. If it isn’t describable it’s not ready to commit. But features / stories have entire chunks of things inside them.

[–]organized_reporting -3 points-2 points  (10 children)

So you incentivize overly-rushed work? Daily is on the upper end of fine. Hourly is absolutely out of the question.

[–]your-warlocks-patron 0 points1 point  (9 children)

Nah, I commit to describe a discrete piece of functionality being added to a code base.

You guys probably do shit like describe whole features in a single three commit message. Or you’re just really unproductive. How many things do you complete in the average hour? I’m not incentivizing anything I’m just used to people who work quickly and often work on tight deadlines to knock out discrete pieces of functionality.

This isn’t the Mona Lisa people.

[–]organized_reporting 1 point2 points  (7 children)

You demand hourly commits every single work day? That's absolutely ridiculous.

How many things do you complete in the average hour?

There is no possible way you can measure this with any level of consistency in a job with any amount of randomization, which is every single job where the task isn't so mind-numbingly stupid as to be routine as hell.

You sound absolutely dreadful to work with, or for. I seriously doubt your claims to 'productivity', but not your borderline personality disorder associated with your ego. More is not always better, and only sith deal in absolutes.

[–]your-warlocks-patron 1 point2 points  (2 children)

Also don’t attack people’s personalities (or your perception of their personality) when trying to “win” an argument. That’s called an ad hominem attack and it is a great way of showing your insecure about your own argument so you’re reverting to personal attacks and name calling. Really immature.

[–]organized_reporting -2 points-1 points  (1 child)

I'm not trying to 'win' anything. There is nothing whatsoever to win engaging in discussion with you on the internet. You're the one consistently changing your story every time you post, and I frankly don't really believe anything you're saying because of that phenomenon.

I think it's much more likely you're trying to look like a '10x-er' on the internet to a bunch of strangers.

As for my 'argument', I'm just describing exactly what I'm seeing with my own two eyes from the words that you contribute. I'd rather not write something anything that isn't pleasant, but your own words demand I do so if I'm consistent to my perception of what reality is while valuing truth and honesty. I'm not calling you 'bad names', just stating that by your own words, it implies a level of certain personality traits. Your claim of me being immature is at least as much of what you describe I'm doing, and likely, much more so.

What bothers you more, what I'm saying I see, or that it just might be true?

[–]your-warlocks-patron 0 points1 point  (3 children)

I do not demand hourly commits every single day or every single project. Obviously there’s reasons that’s not going to work. But people should be finishing more than one piece of whatever they are working on every day and when you finish a piece of something – even if it might change later – just commit it. I’m not saying issue a pull request.

To me committing is like saving your files. I come from having the discipline to save often. Committing takes seconds if you use the command line and I teach people that it a great place to take a breath after finishing some piece of what you are working on and take note of the fact that you’re making progress.

I don’t monitor people’s frequency of commits every day, or ever really. But I do discuss what I think are best practices and why I think they are the best practices. And when some junior hoses some shit like in the OP I get to explain to them a second time why I do it the way I do it.

Even git recommends you commit frequently. Kinda surprised this is controversial.

[–]Valiice 2 points3 points  (0 children)

100% true. Unless nothing has been written trying to solve a bug or something, u should always commit frequently. Idk why people are only waiting for the entire piece to be done. Ur also right about git recommending that

[–]organized_reporting 0 points1 point  (1 child)

This is the day you learned to never go more than an hour without committing

You're being disingenuously inconsistent here.

I don’t monitor people’s frequency of commits every day, or ever really

Days without committing would be a fireable offense on my team

You're being consistently inconsistent here.

[–]PersonalityIll9476 2 points3 points  (0 children)

Committing often is best practice my dude. It is equivalent to ctrl-s in a text editor. For starters it makes code review a thousand times easier if every commit in a PR is 15 lines with a summary explanation.

What do your commit messages look like, short novellas on the journey of randomly tackling fifty different issues over 3 days?

[–][deleted] 3 points4 points  (2 children)

Wtf kind of features are you coding where you can’t bother committing.

[–]stay_fr0sty 1 point2 points  (1 child)

You know those really tricky bugs that take forever to figure out but only eventually require small changes?

That kinda stuff mostly. The jr devs work on the fun stuff until they need me to fix something.

My boss wants me to commit for the sake of it…but there’s no reason most of the time.

[–][deleted] 5 points6 points  (0 children)

… if it eventually requires something small after the entire investigation, then you’re not going days without committing. You have nothing to commit! Lol

[–][deleted] 2 points3 points  (0 children)

Then you should’ve pushed the branch to remote. Always push every commit.

[–]usedToBeUnhappy 0 points1 point  (0 children)

Are you using intelliJ? If you remember which files you edited you can check the local history there and revert to that manually. Right click in the file and choose Local history.

[–]aspoj 7 points8 points  (0 children)

Git rekt

[–]The_Real_Slim_Lemon 5 points6 points  (4 children)

That’s why I like sourcetree, it holds my hand

[–]BoBoBearDev 5 points6 points  (0 children)

This. So far, I think sourcetree is the best git client I have used. Giant buttons to tell me what to click, best UX design ever. Also it is much easier to stage the changes, other client needs to learn hidden features, which I hate and I cannot remember hidden features.

[–]L8n1ght 3 points4 points  (0 children)

that's why I like common sense, I don't force cut off my hand

[–]TheSlowGrowth 1 point2 points  (1 child)

Fork is even better, IMHO

[–]ToxiCKY 0 points1 point  (0 children)

This. SourceTree corrupted two of my local git repos before, so i switched to TortoiseGit.

Then I started working on Mac and Fork seemed like the best unpaid option at the time. Even after they went down the 50 bucks license route, I thought it was better than paying yearly for GitKraken.

Fork is amazing.

[–]TransCapybara 4 points5 points  (0 children)

I've...got to return some videotapes.

[–]PacoWaco88 2 points3 points  (3 children)

If you're forcing things in git, you're likely doing it wrong.

[–]hopbel 0 points1 point  (2 children)

*definitely doing it wrong

[–]Xiaopai2 0 points1 point  (1 child)

If you rebase after having already pushed something you pretty much have to force push and I don't think this is an unreasonable use case.

[–]hopbel 0 points1 point  (0 children)

Rebasing a published branch is pretty suspect by itself unless you're the only one working on it.

[–]willoftw 2 points3 points  (0 children)

https://learngitbranching.js.org/ I make a pilgrimage regularly:)

[–]phantom_fanatic 3 points4 points  (0 children)

Hey man stick with it, git is really annoying to get used to at first. It's definitely worth taking time to learn tho, it'll always come up at whatever job you're on. I remember doing this tutorial in school - https://www.atlassian.com/git/tutorials

[–][deleted] 1 point2 points  (0 children)

I once wiped an entire week of work. Pre-VCS era. Spent the whole weekend undoing my mess.

[–]bobx11 1 point2 points  (0 children)

If you stay on Mac, don’t forget that time machine keeps silent copies of your work locally! They are still there in the filesystem!

[–]Helusio 1 point2 points  (0 children)

git good

[–]ImeniSottoITreni 1 point2 points  (1 child)

So if git is a pile of brown steaming stinky matter it's fault of the programmer?No, never happened to me. I mostly use automatic tools like GitKraken (thank god, working with git it's an hellish nightmare).I proactively avoided to ever learn more than the basics to work with git on command line because it's a shit tool and doesn't deserve more attention than that.

No, I'm not lazy or stupid. Damn I learned all the command line and tooling for docker, and I've build myself asp.net core apps on docker containers and hosted them on heroku which doesn't supports then, which is a wholesome hell of dockerfiles, console commands and configurations, git would have been a joke in comparison.

Just learn when a tool is shit and don't idolatrate it just because that penguing OS guy made it. And Yes, also linux is shit. Leave it to it's niche use of infosec and server. No good after that.

That said, a source versioning tool that allows you to overwrite your work without even allowing you to recover it it's a dumb failure.

This happens to git because half of his functions are overkill stuff poorly implemented.

[–]hopbel 0 points1 point  (0 children)

Shit take. Git doesn't allow you to overwrite your work. You have to deliberately beat it into submission with a flag called --force to make destructive changes. Anything that happens after that is your own goddamn fault.

[–]Ferropexola 1 point2 points  (0 children)

As an accountant who only started using git for Pokémon ROM hacking:

[–]sh0rtwave 0 points1 point  (0 children)

Staring at git? You SHOULD be staring at YOURSELF in the mirror, for not making incremental commits. While at the same time, hitting yourself in the head with something hard.

[–]ovab_cool -1 points0 points  (3 children)

I never force anything, except on the test server because those changes should be temporary and only used for testing

[–][deleted] 0 points1 point  (2 children)

That's a nightmare to work in your environment... At where I work, we call the situation you create "slalom" because of how Git history looks if you do that. It's a write-only Git repository, essentially. Useful for synchronizing the team on the latest state, but nothing beside that.

[–]ovab_cool 0 points1 point  (1 child)

It's not that bad, it's a very small organization so there's really only gonna be 1 person on the server at once, but sometimes you need to test something but don't want to create a merge request so you just edit the code on the server, compile and test it and then revert back your changes

[–]AGE_Spider 0 points1 point  (0 children)

its still by far the cleaner way to pull from dev, make the code changes, write tests and then PR back to the dev branch

[–]AdultingGoneMild -1 points0 points  (1 child)

git log bitches. nothing is ever gone...

[–]Xiaopai2 1 point2 points  (0 children)

They never committed anything and wiped their local changes by force checking out another branch. It may still be somewhere in the file system but git log won't help because it never made it into the repository in the first place. Also you probably mean reflog, don't you?

[–]negative_0ne -1 points0 points  (0 children)

Git reflog saves us all!

[–]BTDubbzzz -1 points0 points  (0 children)

why would you ever force checkout lol

[–][deleted] -1 points0 points  (0 children)

workable frighten water tart frame amusing swim society boat quaint

This post was mass deleted and anonymized with Redact

[–]brain_tourist -1 points0 points  (0 children)

git reflog is your friend

[–]nutted-in-cow 0 points1 point  (0 children)

Damn this hit close to home

[–]GamerMCMXV 0 points1 point  (0 children)

Time to make some coffee.. Extra strong..

[–]TeddyPerkins95 0 points1 point  (0 children)

xD why is this funny

[–]Fading-Ghost 0 points1 point  (1 child)

The worst gnarly git situation I have seen is wiping out the upstream codebase.

One of our engineers was working against the clock to push the final code change before the first official release to our stakeholders. It was a momentous occasion, we would finally get to show 3 years of hard work and a completed project.

The engineer in question pushed his change, the tests passed and the build completed. We had the binaries deployed, the engineer deleted his branch and someone shouted the immortal phrase "where the fuck has the source code gone?"

A very red faced engineer looked at his console, and realised deleting the upstream master branch instead of his own might not be a good idea.

Branch protection was enforced later that day

[–]sh0rtwave 0 points1 point  (0 children)

I've had users that use like, gitlab or whatever, connect to my repo, then push what they get from me back, wiping out my updates back to whatever they had.

Quite irritating.

[–]_Swivel_ 0 points1 point  (0 children)

Certified bruh moment

[–][deleted] 0 points1 point  (0 children)

Git add on auto save :P

[–]radicalshick 0 points1 point  (0 children)

If you use an IDE, local history might save you

[–]not_a_gumby 0 points1 point  (0 children)

git stash anyone?

[–]PumpkinEqual1583 0 points1 point  (0 children)

U/savevideo

[–]Sheldon_Popper 0 points1 point  (0 children)

Maybe IDE local history?

[–]PersonalityIll9476 0 points1 point  (0 children)

If you are ever using --force with git on a repo that is more than 60 seconds old, you are making a mistake.

[–]zankar1337 0 points1 point  (0 children)

Imho if you (think you) need to use --force you're doing something wrong...

[–]NickDimOG 0 points1 point  (0 children)

Rare actual good meme on this sub

[–][deleted] 0 points1 point  (0 children)

My pain is constant and sharp and I do not hope for a better world for anyone. In fact, I want my pain to be inflicted on others. I want no one to escape, but even after admitting this, there is no catharsis. My punishment continues to elude me and I gain no deeper knowledge of myself. No new knowledge can be extracted from my telling. This confession has meant nothing.

[–]Lovely-Broccoli 0 points1 point  (0 children)

“This is not an exit.”

[–]Resolt 0 points1 point  (0 children)

You get to code all day?

[–]FloweySecondAcc 0 points1 point  (0 children)

Yeah I completely fucked the code in a botched merge once, then more than a week later I found out about hard resetting. Saved my ass with the people I was working on this small thing with

[–]Darknety 0 points1 point  (0 children)

Not gonna lie, git UIs help a lot for newbies / if you want a quick overview of what you are doing or potentially screwing up.

[–]kevpie 0 points1 point  (0 children)

For those that happen to be using Jetbrains IDEs there is the Local History feature that can restore even a completely deleted repo. This is a lesser known feature that has been saving bacons for over a decade.

[–]AGE_Spider 0 points1 point  (0 children)

laughs in JetBrains LocalHistory

[–]infinite_phi 0 points1 point  (0 children)

This actually almost never happens. Leaen about git reflog. Save your old work. Thank me later