6 ms·
Dangit, Git?
- KerrickStaley 4y agoPrevious discussion: https://news.ycombinator.com/item?id=31874308 https://news.ycombinator.com/item?id=31874308
- remoquete 4y agoIs this the SFW version with no profanity in the URL? I actually applaud that idea—I felt a bit uncomfortable with the former URL.
- zerocrates 4y agoohshitgit has a little banner at the top: "Hi there! You can get this same content without swears at dangitgit.com"
- kzrdude 4y agoI think it's a normal reaction actually. I feel a bit of the same thing and my idea is that it might be related to an uncomfortable feeling of not being sure about the nuance or value of a word. 'Shit' is a known word in terms of meaning but what value it carries in any given context is a bit fuzzy, it can be received very differently.
- aanthracite 4y agoJust avoid rebase and --amend and you will be fine. Your commit log won't be perfect, but also you won't waste your time fixing conflicts and other issues...
- dymk 4y agoYou're just delaying the conflict resolution to when you actually want to merge the branch back in...
- phailhaus 4y agoYou're delaying it to a one-time pain rather than for every commit in your rebase. I've stopped rebasing altogether and it's much more manageable.
- wizofaus 4y agoProblem is there are open source projects where PRs with multiple commits are not allowed. Not much choice but to rebase in that case. I struggled with it a lot at first but haven't had any issues more recently. But personally I'd rather not use it, and don't on other repos I work on. Btw I'd say if you've never had issues with git it's because you've never been forced to do a shallow clone (due to networking issues) or run out of disk space while using it. Had to blow away and reclone repos many times in both cases, but only after hours struggling with cryptic and unpredictable error messages.
- phailhaus 4y agoThat's really interesting, if PR's aren't allowed to have multiple commits then why not just enforce squash-and-merge for all PR's? Then it doesn't matter what you do on your local branch, because when the PR is merged it's squashed into a single commit.
- wizofaus 4y agoExactly what I argued, but it wasn't my call to make...
- Raed667 4y agoI find adults who are uncomfortable around profanity extremely unsettling. Emotions can be extreme (like destroying hours of work because of a git mess-up) language should be able to reflect that.
- xbar 4y agoFuck 'em.
- smrtinsert 4y agoYou are uncomfortable with people who are uncomfortable with profanity?
- JasonFruit 4y agoThe technical term is "metafragility".
- dymk 4y agoObviously there are degrees to this. If an coworker started throwing around profanity and yelling because they got uncomfortable in a meeting, I'd question their professionalism.
- Raed667 4y agoYeah but something like "this shit is fucking hard" wouldn't cross any lines with any reasonable audience.
- deleted 4y ago[deleted]
- unicornmama 4y ago> Git is hard: messing up is easy, and figuring out how to fix your mistakes is impossible. Hyperbolic. Fixing mistakes is easy if you understand the underlying data structure. Once you can conceptual map the structure into the intended form, you figure out what operations (verbs) you need. Then it’s a matter of mapping the operations into concrete command lines.
- darkstar999 4y ago"Rocket science is easy once you understand the underlying principles of rocket science"
- unicornmama 4y agoIt amazes me the amount of engineers who can use a tool every day yet remain not the least bit curious to its basic internal operation.
- ironmagma 4y agoPerhaps it is that they actually are curious, but the amount of knowledge to be had is quite substantial.
- seba_dos1 4y agoI don't think that's the case with git though? It's fairly simple actually. The biggest (only?) challenge is to not view it as a tool to do versioning of your code, but rather a tool to work on data structures that effectively do versioning of your code. It seemed fairly straight-forward to me once I did that mental shift.
- ironmagma 4y agoEveryone says that, but I don’t find it to be true. For context, we run a Gitea fork at work, and I often have to read the source code inherited from upstream Gitea. There are a ton of things that can happen during a merge, for example. Does anyone know what a smudge filter actually is? Why are there branches, and also tracking branches? There are refs, heads, objects, and blobs, and not all of those have the same operations (list, show) defined on them. There are changesets but also snapshots. Why do some commands have a --porcelain flag and others don’t? Did you know Git has garbage collection? You can’t rename a file in Git. What’s the difference between branches and tags? These are all things that are really discovered only through relentless trial and error.
- hprotagonist 4y agolets bowdlerize everything! oh wait fuck that let’s not.
- whimsicalism 4y agoI remember the day I discovered `git reflog.` Truly a lifesaver for a rebase heavy workflow.
- ksylor 4y agoHi there! I am the person who made ohshitgit.com as well as dangitgit.com! I resisted having a swear-free version for a long time! but, I heard from many folks that the swear-y url was blocked by their networks at work or school, and they wanted to be able to view & share the content too. I had also heard from a high school comp sci teacher that they wanted to share the OSG tips & knowledge with their students, but couldn’t because of the swears. So, I decided to create the swear-free version to be more inclusive and allow more people to access the help they needed to get out of their git messes. Cheers, Katie
- remoquete 4y agoThanks for creating this new version—and thanks so much for creating OSG in the first place! I’ve been using it as an educational resource since I found out about it.
- xbar 4y agoBoth versions are useful. One makes me happier than the other. Yes, it's the other one.
- jstummbillig 4y agoBut now you have options, whenever you don't wanna be quite so happy. Nice.
- kristaps 4y agoThanks, will be much more comfortable passing this one to my juniors!
- darepublic 4y agoGood job. Git reflog in particular will save many a developer their lost work
- clarkdale 4y agoHi there! In English, we would normally say "many developers." Hope that helps!!
- fargle 4y agoI like this one: https://news.ycombinator.com/item?id=31874308 https://news.ycombinator.com/item?id=31874308 ( https://ohshitgit.com/ https://ohshitgit.com/ ) better... Great stuff! BUT hopefully the author is reading this: PLEASE PLEASE remove the part about `sudo rm -r fucking-git-repo-dir` or at least if it's satire tell people not to really do this. It should be: cd .. tar -cvzf fucking-git-repo.tar.gz fucking-git-repo-dir echo "Please for the love of god help me I've fucked up and <describe problem>" | mail -s "NEED HEPL! git disaster" git-expert@xyzcompany.com -A fucking-git-repo.tar.gz git clone https://some.github.url/fucking-git-repo-dir.git fucking-git-repo-dir2 cd fucking-git-repo-dir2 As long as you don't delete or muck with the `.git/` folder or files that aren't not be checked in, you have pretty fair odds that the mess can be untangled by someone either more knowledgeable about git or less pissed off.
- thayne 4y ago> But seriously though, on what planet does checkout -- make sense as the best way to undo a file? In recent versions of git you can use git restore, which besides having a better name and not being overloaded with other checkout functionality, has a better interface IMO.
- smrtinsert 4y agoSites like this are great but make me wonder if I'm the only one who prefers using high level ide menu options instead.
- ajb 4y agoThe problem with high level IDE menus is that they are a leaky abstraction. And when something goes wrong at a lower level you are stuck only knowing how the abstraction works and need to figure out the how the actual tool works at the point of maximum stress, in situation complicated by something already having gone wrong.
- cratermoon 4y agoThis seems like a good place to mention that I had a co-worker who thought that git only allows 50-character commit messages. Why? Because the IDE was programmed to guide the user to the 50/72 rule[1] and would put up a warning when the first line went over 50 characters. It never occurred to my co-worker that he could simply hit the return key and create a multi-line commit message. So not only are they leaky abstractions, when they do hide abstractions they can conceal important information. 1. https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html https://tbaggery.com/2008/04/19/a-note-about-git-commit-mess...
- ttymck 4y ago> Only amend commits that only exist in your local copy or you're gonna have a bad time. Would you consider linking more information or adding an explanation of "a bad time"? I think it's really confusing for newcomers to understand the implications of "public commits", or even what "public" means.
- everybodyknows 4y agoThe essential question is whether any collaborator might have already based their own work on a commit you've made available to them earlier, by a 'git push'. If so, your pushed work cannot be modified (carrying a new hash) without invalidating theirs (depending upon old hash).
- deleted 4y ago[deleted]
- m0xai 4y ago“Git is hard: messing up is easy, and figuring out how to fix your mistakes is impossible.” No, no and no. If you do know what you do, then you don’t. There are tons of explanation on git, just RTFM.