|
Jabor posted:Therefore, anyone who knows the git CLI probably knows how to actually use git well Sort of? I exclusively use the cli, but 98% of my work is using add/commit/push/pull/checkout/merge and if I encounter a situation even remotely outside of the happy path I get paranoid and start asking someone I trust to double check what I'm doing.
|
# ? Feb 21, 2023 14:05 |
|
|
# ? May 13, 2024 09:58 |
|
Canine Blues Arooo posted:It is completely absurd to me though that there is some weird expectation around 'knowing git' in this world. Yes, you should probably understand what the git words mean and how they map to functionality, but to be able to use the CLI is silly Canine Blues Arooo posted:CLI is a great feature set for certain use cases, but rarely for a human, and I don't take the suggestion to learn the git CLI very seriously. Of all the things I could actively learn, CLIs are such an enormous waste of time...and I don't really know hot hot of a take that is anymore. You don't have to to use the CLI, use what makes you feel comfortable, but you are simply factually wrong that CLIs are only good for scripting or whatever and not humans. I get just not wanting to take the time to learn a tool, after 20 years I still haven't learned sed and use perl pie instead. But it's silly to ignore the benefits of a tool and take some moral stance on it just because I don't want to take the time to learn it.
|
# ? Feb 21, 2023 14:32 |
|
I don’t care how you use git, but I constantly run into people who: * don’t know how to fix a typo in a commit message if it’s not the most recent one * end up with random files in their commits and they don’t know who added them * have no sense of how to partially revert a commit All of which are medium complexity things they come up regularly.
|
# ? Feb 21, 2023 14:55 |
|
Maybe there's stuff I'm completely missing, but understanding add vs commit vs push/pull shows you get the model. The big issue is the way git has the local vs remote repos, so what you think of as main may not be what other people have. Submodules are weird to use but simple in theory, and other stuff are just specific tools that build on the existing model. E: doesn't changing a pushed commit add complexity for other folks? Seems not worth doing to fix a typo
|
# ? Feb 21, 2023 14:56 |
|
Only if it is in a shared branch. In pushed but exclusive branch (usually PRs), it doesn't hurt anyone.
|
# ? Feb 21, 2023 15:29 |
|
I prefer the git CLI, but I'm also the weirdo doing a bunch of other poo poo on the command line. I chalk it up to preferencesmackfu posted:I don’t care how you use git, but I constantly run into people who: Send them this: the git fuckup CYOA
|
# ? Feb 21, 2023 16:07 |
|
The CLI/GUI distinction is not the important part here. The main issue is understanding the underlying model and knowing how to get out of an unintended state. If you can do that with the CLI, cool. If you can do that with your favorite desktop GUI tool, cool. The important part is to understand what a commit it, how remotes work, how branches work, how to understand the log, the difference between staged and unstaged files, and so on. That being said, the best way to get good at git is just to screw up enough times, panic, get expert help, and eventually internalize the troubleshooting process.
|
# ? Feb 21, 2023 16:18 |
|
I work in command line all the time and I can only do like 4 things in git without having to google it, and tbh not that many more actual linux commands despite using it all the time lol
|
# ? Feb 21, 2023 16:38 |
|
I learned the most about git when I nuked a remote branch and had to figure out how to fix it with an interactive rebase (my memory is a little vague of what I actually did). Everyone should learn to use git by destruction. Less jokingly, I found the CLI a much better tool for understanding the model of git, but that’s anecdotal. Also, nvim over any ide because why not throw that in there.
|
# ? Feb 21, 2023 18:11 |
|
Nothing teaches you about git like horking the local working copy of a multi terabyte monorepo and knowing it would take all day to clone a new working copy from the remote.
|
# ? Feb 21, 2023 18:13 |
|
It took me years to get over the hump with git commands that have '--' in them because I didn't realize that's a convention for "and now we have subcontextual command line arguments to give to everything that was sprayed left of here." Something I hate about the Linux kernel culture locally here is sending patches without specifying a base commit hash. I don't care if it's master. Whose master? When? Even better when I tell them the commit hash I used and they come back saying they couldn't figure out how to apply it (even though they were the ones who told me to send them a patch). They just slapped it on their master and it puked. Amazing.
|
# ? Feb 21, 2023 18:14 |
|
captkirk posted:Nothing teaches you about git like horking the local working copy of a multi terabyte monorepo and knowing it would take all day to clone a new working copy from the remote. Protip: if you run a recursive find/replace from the command line in the root directory of a git repo, it will touch files in .git and at that point your copy is unrecoverable.
|
# ? Feb 21, 2023 18:41 |
|
FlowerRhythmREMIX posted:I learned the most about git when I nuked a remote branch and had to figure out how to fix it with an interactive rebase (my memory is a little vague of what I actually did). Everyone should learn to use git by destruction. This is true. I wouldn't know nearly as much about git if I hadn't hosed things up and desperately scrambled to fix them. Just don't make your fuckups somebody else's problem.
|
# ? Feb 21, 2023 18:48 |
|
ultrafilter posted:Protip: if you run a recursive find/replace from the command line in the root directory of a git repo, it will touch files in .git and at that point your copy is unrecoverable.
|
# ? Feb 21, 2023 19:36 |
|
Thankfully, I haven't had to do anything with Git beyond the happy path. I would be at a lost. For instance, I know there's a command called rebase. But what does it do and in what situation would I use it?
|
# ? Feb 21, 2023 19:40 |
|
You use it to
|
# ? Feb 21, 2023 19:45 |
|
I've tried maybe half dozen git gui tools and it's crazy that all of them made interactive rebases way more difficult than the cli
|
# ? Feb 21, 2023 20:18 |
|
What's cherry picking and how is it different from rebasing?
|
# ? Feb 21, 2023 20:31 |
|
Obfuscation posted:I've tried maybe half dozen git gui tools and it's crazy that all of them made interactive rebases way more difficult than the cli Sublime Merge one of them? It's one of the few that I still like. I've tried GitKraken, Fork, you name it. Always go back to smerge.
|
# ? Feb 21, 2023 20:36 |
|
AlphaKeny1 posted:What's cherry picking and how is it different from rebasing? It's the same thing just done from different perspectives Also branches are just pointers Now you know git
|
# ? Feb 21, 2023 20:41 |
|
When I worked on a Mac, I used sourceTree and never understood why someone would use the CLI. When I switched to a Linux distro, all the GUIs I could find sucked so much, it was just easier to learn the CLI (which, tbh, isn't very difficult, it's almost 1 for 1 what you do in the GUI, just with commands).
|
# ? Feb 21, 2023 20:46 |
|
AlphaKeny1 posted:What's cherry picking and how is it different from rebasing? Cherry-picking just takes an existing commit from someplace and applies it onto your current branch as a new commit, as though you had just made that commit onto your current branch in the first place. You would cherry-pick if you wanted to, for example, land a fix from trunk onto a hotfix branch for a release, or vice versa, without merging all the commits from the entire branch. Vulture Culture fucked around with this message at 20:55 on Feb 21, 2023 |
# ? Feb 21, 2023 20:52 |
|
Somehow I always pick the wrong choice between “cherry-pick” and “cherrypick”. Even right now, no idea which is right.
|
# ? Feb 21, 2023 21:27 |
|
ultrafilter posted:Protip: if you run a recursive find/replace from the command line in the root directory of a git repo, it will touch files in .git and at that point your copy is unrecoverable. But then you get to learn about zfs snapshots!
|
# ? Feb 21, 2023 21:32 |
|
You use rebase to clean up your local branch before pushing to remote for code review so they can’t see how many committees it took for you to fix that typo
|
# ? Feb 21, 2023 21:54 |
|
Or you can just use a single commit and amend as you go along. Multiple commits is better for rollback-ability though.
|
# ? Feb 21, 2023 21:58 |
|
I have started amending commits more often now, but there is something satisfying about an interactive rebase and using fixup
|
# ? Feb 21, 2023 21:59 |
|
git add .; git commit --amend --no-edit; git push --force
|
# ? Feb 21, 2023 22:27 |
|
I’ve always used —force-with-lease
|
# ? Feb 22, 2023 00:00 |
|
Vulture Culture posted:Rebasing is . . . FlowerRhythmREMIX posted:I have started amending commits more often now, but there is something satisfying about an interactive rebase and using fixup I agree but I had to strip a suggested procedure out of a document I wrote locally because that completely destroyed brains and they chose to instead drop the document and just cowboy everything. Well, that was inevitable and if it weren't that, it would be something else, but I had their attention up until that point. FlowerRhythmREMIX posted:I’ve always used —force-with-lease Today I learned . . .
|
# ? Feb 22, 2023 00:56 |
|
FlowerRhythmREMIX posted:I’ve always used —force-with-lease its safer yeah, but most of the time I'm on my own branch and don't have to worry about blowing away other peoples work until I have to resolve merge conflicts
|
# ? Feb 22, 2023 01:04 |
|
I've been using ChatGPT a lot over the past couple weeks. It's not all-devs-are-fired good, but I can paste in little code snippets i anonymize and ask it if it there's a refactor opportunity it sees for rubber ducking, or ask it to add comments to what the code does, and it's been super helpful. It's also been better for a lot of things I would search google for too, like the name of a method in a library, etc. It's great for doing some of the stuff that's time consuming but not particularly difficult (like adding code comments). It's not at the level where I can just copy paste everything it outputs, as it is often wrong and almost always redundant, but it's still making me more productive. I wouldn't go through pasting all of our files in there for comments, since most of that is low value and obvious stuff, but it's been useful for scripts in dusty corners of some apps we own and barely touch, or some scripts that are used in CI and are difficult for all of the folks who are afraid of the build to go parse, use and maintain. Also good for documentation and how-to stuff, where you need some definitional table setting for explaining things to someone who is totally new. Again, needs a lot of editing, but better than staring at a blank page with a blinking cursor. It's also great for slack announcements when I'm turning a thing on and I need something phrased in a generic, friendly corporate voice. I kind of hate how useful it's been and how I keep using it more and more every day. I'm wondering if I should be using GitHub's co-pilot for some of this stuff instead, with the understanding that much of its output is unusable and all of the caveats and conditions that apply. biceps crimes fucked around with this message at 02:21 on Feb 22, 2023 |
# ? Feb 22, 2023 02:17 |
|
--force-with-lease should be the default and regular --force should be an extremely unusual thing to need.
|
# ? Feb 22, 2023 02:23 |
|
I've been using ChatGPT mostly for medium complexity syntactical questions, and some random debugging. It does a very decent job in general, and while it sometimes has errors, it's close enough that I can plug the holes myself. It's more or less replaced Stack Overflow for me.
|
# ? Feb 22, 2023 06:29 |
|
It's pretty decent at making GBS threads out unit tests
|
# ? Feb 22, 2023 06:42 |
|
Works great for generating typescript types from json responses. Also feels like it gives good explanations and not just code snippets.
|
# ? Feb 22, 2023 08:50 |
|
Eh I've seen it respond with such glaring errors I just don't trust it with anything. On a side note for those who do like it, would you be willing to pay for it? They claim they want to keep a free tier but it's still during the hype phase, I see that going. The current trial sub is $20 a month.
|
# ? Feb 22, 2023 08:57 |
|
The thing that scares me the most about chatgpt is how effortlessly it destroys leetcode/hacker rank questions. I don't envy people trying to do remote interviews of coders post chatgpt.
|
# ? Feb 22, 2023 09:21 |
|
Plorkyeran posted:--force-with-lease should be the default and regular --force should be an extremely unusual thing to need. Agreed, sadly one of those things was implemented first and now everybody uses it, and it is not the longer option. FlowerRhythmREMIX posted:I have started amending commits more often now, but there is something satisfying about an interactive rebase and using fixup git commit --fixup {commit} and then git rebase -i --autosquash
|
# ? Feb 22, 2023 10:57 |
|
|
# ? May 13, 2024 09:58 |
|
Update I've got some semblance of a working Master now. And the idiot Dev provided me with the changes he has to get out cherry picked, so this release can go out. Finally, light at the end of the tunnel. Let's just test deploy...SQL time out.... "...Did you test this script before you gave it to me?" "No" I feel really sorry for his line manager, she's only been in the position a week today. Mega Comrade fucked around with this message at 12:34 on Feb 22, 2023 |
# ? Feb 22, 2023 12:29 |