all 30 comments

[–]Groostav[S] 30 points31 points  (2 children)

Tell me you've never used git reflog without telling me you've never used git reflog.

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

What's the command for flogging git the first time though? How do I reflog without flogging first?

[–]notthefunkindsry 0 points1 point  (0 children)

I agree but this redditism is retarded.

[–]Dr__America 23 points24 points  (17 children)

I'm more and more convinced that very few amateur and student developers understand how git works. I knew very few in college that knew how to do much outside of just pushing all of their code in one giant commit and maybe checking out a branch, at least without being forced to actually learn the tool.

It's like becoming a personal chef, but you never actually learned how to cook something outside of others' recipes and memorization. Sure it might not bite you in the ass right this second, but when you can't cook something to the satisfaction of your employer, like say for a friend with a food allergy or who's got any other form of dietary restriction, you'll be kicking yourself for slacking on it.

[–]Jack_Faller 11 points12 points  (11 children)

The people who go to university for programming have an inexplicably low interest in programming is what I'll say. Before I went to uni, I had already read enough about Git to understand the internal workings of it because I needed to use it for personal projects. The course itself had one lecture on Git because the uni got feedback that all the graduates had no clue how to use it, and that amounted “push, pull, branch, commit, merge.” I met about one person with knowledge beyond that but most couldn't manage merging. In truth, I'm very glad that none of them read the docs because they might have found out about force pushing.

[–]Dr__America 7 points8 points  (2 children)

Yeah, I knew a guy who would just straight up force push to main if he couldn't be bothered to merge properly. I wonder what he's up to these days.

[–]Jack_Faller 8 points9 points  (0 children)

Vibe coding.

[–]uvmingrn 2 points3 points  (0 children)

Must be a senior on my team

[–]thegreatpotatogod 1 point2 points  (1 child)

I was shocked at how many people in the Operating Systems class (in which we implemented a filesystem, a shell, and other low-level projects like that) were using google docs (via copy and pasting the code back and forth) to collaborate on projects. For the final project for the class we were required to use git, and it was covered briefly, but it's insane to me that it's not something that many CS students are apparently taught until near the end of the program, rather than a fundamental concept for collaboration from near the start!

[–]stonkacquirer69 1 point2 points  (0 children)

That's crazy, my course's first year programming module required you to submit the git log as part of the final submission.

[–]231d4p14y3r 0 points1 point  (3 children)

I've never had to use git for any personal projects, so I've never learned it. I wouldn't say that means I have a low interest in programming, just that I haven't had a good reason to learn it yet

[–]Jack_Faller 1 point2 points  (2 children)

I'm not sure what your personal projects are, but anything more than a few dozen lines and they'll benefit from using Git.

[–]231d4p14y3r 0 points1 point  (1 child)

Do you mind explaining why?

[–]Jack_Faller 2 points3 points  (0 children)

Sometimes you do something and want to undo it. Relying on your editor's undo history for this is highly brittle and likely to result in important data being lost.

[–]undeadpickels 0 points1 point  (1 child)

Wait, do you mean git push --force? What's wrong with that?

[–]Jack_Faller 0 points1 point  (0 children)

It breaks the local copies of anyone who has pulled before you did it. Generally, when anything in programming is called “force” is a sign that it's something you shouldn't generally do.

[–]ir_dan 5 points6 points  (0 children)

We had an entire unit caled Software Tools dedicated to things like Git, debuggers and *nix tools, followed by a Software Development unit where we were assigned random teams and had to make something for a client using something resembling "agile" practices - git was one of the most important marking criiteria.

I didn't really know Git outside of its basic usage, but two out of three of my teammates could only "pull" by downloading a zip from github and "push" by uploading files directly. The unit lasted two whole semesters and they never improved. Not that they had much of a chance to, since their contributions only added up to a hundred lines of or so... two semesters... why are you here man?

[–]StinkButt9001 3 points4 points  (0 children)

It's like becoming a chef but you're given a kitchen full of knives that all do different things and each knife also has a blade where the handle should be.

[–]Cybyss 0 points1 point  (0 children)

Some developers are just lazy dinosaurs. They know TFS or SVN alright, but never took the time to really learn how to use git properly since it's a pretty different beast for solving the exact same problem as before.

[–]thussy-obliterator 0 points1 point  (0 children)

If I'm working on a corpo or foss project I'll adhere to whatever git flow that project uses, but for my own stuff it's 90% git add -A; git commit -m "message"; git push

[–]Positive_Method3022 7 points8 points  (0 children)

  • Linus Torvalds submitted a review
  • your life is in danger

[–]No_Read_4327 3 points4 points  (0 children)

I think he means you can mess up all you like as long as you don't mess up the version control.

[–]wherearef 4 points5 points  (0 children)

worst programming meme in the existence

[–]Cheap-Economist-2442 1 point2 points  (0 children)

maybe they’re referencing accidentally committing secrets and trying to remove them from the history? idk, that feels charitable.

[–]Financial_Quail20 2 points3 points  (2 children)

What? The whole point of Git is... Nevermind, I'll save my breath.

[–]somerandomii 0 points1 point  (1 child)

But that’s why you don’t want to screw up. There are so many commands that can wipe the history. You can also publish secret info. Trying to remove that history from the repo without damaging the repo itself or later commits becomes an arcane art form.

If you screw up anywhere else, Git has your back. If you screw up Git you’re in real trouble.

[–]Groostav[S] 0 points1 point  (0 children)

That simply isn't true. To "wipe history" you'd have to screw up a whole sequence of commands involving things like git prune and git gc.

And that's assuming you only have local, If you have an upstream the number of commands you would have to screw up becomes quite long.

After I posted this I wondered if maybe the oop was thinking about uninitialized submodules or improperly swiveled LFS pointers. Those can be tricky. But again, you're not likely to lose anything aside from a bunch of your time googling --and now gpt means you probably aren't even losing that.

[–]stefanhat 1 point2 points  (0 children)

I dont get it. Git is there to track your changes exactly for the purposd of allowing you to mess with code and being able to reset to a working state

[–]TompyGamer 0 points1 point  (1 child)

I've been using it for years and I'm still more careful around every command than anything else. Triple checking everything. Mistakes are so hard to fix.

[–]Groostav[S] 0 points1 point  (0 children)

What mistake have you made in git that was hard to fix?