175
u/stormdelta 1d ago
This sub's always had a problem with bad jokes that don't make sense, but it seems like it's gotten a lot worse lately.
A lot of these feel like they're made by people who have no idea how git works or how to use it.
88
u/ListerfiendLurks 1d ago
Right? The OP described exactly how git is SUPPOSED to work.
14
u/emu_Brute 1d ago
You do want to minimize feature branches though. Merging 17 feature branches for a release is how git is designed to work, but not how you're supposed to use it.
Ai can only do so much with merge conflicts
27
u/ListerfiendLurks 1d ago
It depends on the amount of work being done. Every FAANG and FAANG adjacent I have worked at demanded PRs be broken up into multiple smaller feature branches if they got too big.
5
u/Theron3206 1d ago
I routinely merge that sort of number, maybe 10% of them have non trivial conflicts. We just group work on the same part of the core base as best we can.
It's a nearly 30 year old pile of anti patterns too, not some pinnacle of modern design principles.
9
u/jordanbtucker 1d ago
Right, I saw a post the other day about someone complaining about how git works great until two people want to work on the same file at the same time.
That's exactly what git was designed for. It's a "Distributed" Version Control System for a reason.
1
u/DoomBot5 14h ago
Git does have that problem. Git merges are a pain. Having said that, files should be kept small enough that this doesn't become as much of an issue.
1
u/awesome-alpaca-ace 6h ago
The problem is the algorithm used for the diffs. Just formatting files makes git conflict everything.
3
6
3
u/KevlarToiletPaper 1d ago
Take it easy, most posters here, like OP just had their first IT classes and they just talked about git. Let them have their fun.
1
u/Head-Bureaucrat 1d ago
I was about to reply: that happened on a team I was on well before AI? Like... Fucking git flow is a thing, and it makes me super sad.
1
u/DoomBot5 14h ago
That's because they're written by humans. Those meat bags don't contain the vast knowledge needed to meme properly.
52
1.1k
u/GildSkiss 1d ago
As opposed to humans, who have famously never messed up git commands ever.
71
u/Bubbaluke 1d ago
Can’t mess it up if you only ever use 3 commands
35
u/spicybright 1d ago
WELP, time to re-clone the whole repo!
38
u/throwaway85256e 1d ago
Honestly, burning it all down and starting over is sometimes a perfectly valid solution.
7
u/PrincessRTFM 1d ago
I have needed to do that before when I fucked it up so badly that not only could I not revert but also couldn't find any solutions online. I was, in my defence, very early in the learning phase and not really understanding how anything worked yet.
6
u/Honeybadger2198 1d ago
The closest I've come is where I committed a >50MB <100MB file to my repo and didn't notice for a few days. Had to manually go in and purge the file from the history to unfuck the repo.
2
u/spicybright 1d ago
It definitely is. Even as a senior dev "git wizard" I'd rather wait 5 minutes recloning vs spend 20 untangling a ball of knots if it gets it to the desired state.
7
u/TwoAndHalfRetard 1d ago
git add .
git commit -m "" --allow-empty-message
git push -f
5
1
u/Foorinick 1d ago
I havent worked in professional enviroments but im too autistic not to fill out all the forms so for me its more like
(In branch "feature name")
Git add.
Git commit -m "feat(part of software): fixes thing" (because apparently somewhere it reads "this commit (commit message)")
Git push
Git squash (its been a while i dont remember the rest)
Git merge feature into main or whatever
Git checkout main
1
u/forma_cristata 1d ago
You were almost there
Git pull
Git checkout -b feature/something
Repeat
→ More replies (1)55
u/TerminalVector 1d ago
It's pretty easy to stop your AI from fucking up git if you know how to not fuck it up yourself. Otherwise it'll help you fuck up faster
11
u/adabsurdo 1d ago
Don't know about copilot since I haven't use that one in years but for more advanced models like opus and sol this is a non issue. It will manage git better than most senior engineers would.
9
10
u/TerminalVector 1d ago
Not if you tell it to do dumb stuff it won't. It'll resist and try to do smart things, but then also try to be compliant and will end up doing crazy shit
5
u/adabsurdo 1d ago
I guess but ultimately this boils down to operator Incompetence. I can force Claude to do stupid shit but then whose fault is it when stupid shit results? What I'm saying is it will follow best practices and won't trip itself up doing even complex tasks like rebase with conflicts
5
u/TerminalVector 1d ago
You're probably following good hygiene in general and not making vague unclear requests. It boils down to operator incompetence but it's way easier to be incompetent if you don't actually understand how git works.
1
u/Rich-Environment884 1d ago
That just applies to AI in general no? Just accelerate whatever you already did, it won't magically make u good at ur job...
1
259
u/TheModWhoShaggedMe 1d ago
Ah, so replicating human faults on steroids must be the solution!
<sippy cup>
17
u/perestroika12 1d ago
Also completely ignoring the fact that humans are in the loop for every command they run instead of sending the robots off on a rampage
5
13
u/RedditName9000 1d ago
seriously, we had more than a few fire drills because somebody did a bad merge and needed someone senior to unravel the damage. Now anybody can just ask an AI to sort out the rebase, It's sort of sad and nostalgic that I may never help a junior fix their bad merge again. If I'm lucky I'll see a really severely botched attempted repair of a merge conflict by a misinformed AI, that'll be fun.
20
u/tragiktimes 1d ago
We're in such a strange stage between understanding what code and logic does, and allowing an AI to complete those code and logic steps. It's an area where if you don't hold on to your knowledge , you'll find that you quickly have no idea what's going on. But if you try to manually do everything, you'll find that you're behind just about everybody else using the tools available to them.
7
u/spicybright 1d ago
Well said. It's kinda scary, the industry will implode if AI improvements hit some kind of hard wall. We'll have mostly ai programmers with all the pre-ai people retired, and then what? Computer science innovations just... stops, I guess?
2
6
16
2
u/theycallmeJTMoney 1d ago
Also just give AI implicit instructions on how you want your merge process to work. I’ve never had it randomly decide to cut a branch or merge incorrectly. I think some people are trying to hard to offload every aspect of development and it’s kinda wild.
1
u/tragiktimes 1d ago
It will allow you to fuck yourself so hard and so fast. That's pretty much the only difference.
1
u/DMoney159 1d ago
Flashbacks to my first job hearing my coworker randomly yell "I HATE GIT" and thinking "how did you fuck it up this time?
→ More replies (1)1
u/abdulsamadz 1d ago
Until the day I had started using git, I had never messed up git commands. There's a life lesson in the preceding sentence and I'll leave it to the class to find it for themselves.
25
u/Tim_TheDude 1d ago
Me who uses git for years and all I do is checkout/commit/push and rarely I somehow resolve a conflict
104
u/zzulus 1d ago
Hold on, people actually use Copilot?
113
u/xaervagon 1d ago
The Copilot in Visual Studio is a wrapper for the other AI agents. It's surprisingly decent
54
u/HTTP_404_NotFound 1d ago
*Github copilot, specifically.
To the original poster, since you can use the claude agent / models with it, well, it works quite nicely. Can also build custom agents with it. Use whichever models you want.
Github copilot is NOT the same as "copilot" or "microsoft copilot".
I'm sure, a lot of the code is shared, but, they are not exactly the same. Github copilot is pretty good.
Though- for the above commentor- I will say- VSCode's integration just blows visual studio out of the water. More lightweight too.
Though, if I'm actually writing code, its hard to be visual studio. But, for bug fixes, small features, etc.... vscode works better here.
8
u/Schnickatavick 1d ago
It's a similar distinction between Claude and Claude code, they're very different products intended for very different audiences. You really shouldn't be using the generic Claude website for coding, and you really shouldn't be using Microsoft copilot
if you're a person with self respectfor coding either.3
u/HTTP_404_NotFound 1d ago
While I use claude code personally either via its linux app, or vscode plugin, and do agree, that it is BY FAR superior to anything copilot- (Edit- or micro-slop in general....)
Those of us who work for companies do have to roll our eyes at the business processes of where it has to travel through legal... contracts... finance.... etc, which sadly, in some companies can take a very long time.
Meanwhile- we also have to justify the price for it, which is quite funny, as it will likely cost LESS then m$osft copilot, while producing better results too.
SO....
and you really shouldn't be using Microsoft copilot if you're a person with self respect for coding either.
Its not a matter of wants- its a matter of, if I go swipe the company card, purchase and use Claude, I'm going to have Legal, HR, Contracts, Finance, Compliance, Security coming to find me... and I'll be looking for a new job tomorrow, cause, company policy, ofc.
2
u/Tiny-Plum2713 1d ago
Claude costing less than copilot? You should see the bills in large sw companies lmao
2
u/HTTP_404_NotFound 1d ago
Lol, I don't want to. I... already see and answer for the copilot bills, and well...
Its cheaper then more heads, i guess.
3
u/DaniilSan 1d ago
I dunno. Maybe because I use it with WSL, GitHub Copilot is stupidly slow when compared to Claude Code or Antigravity CLI (and Gemini CLI before it got killed).
→ More replies (4)1
u/heavy-minium 1d ago
An AI model without a harness isn't an agent. It's the harness that makes it into an agent. So calling it a wrapper for other AI agents is incorrect.
16
4
2
→ More replies (2)1
u/jordanbtucker 1d ago
GitHub Copilot. Not Microsoft Copilot.
Yes, they're both Microsoft products, but the GitHub one is way better for code.
14
24
u/cheezballs 1d ago
Wait... What's the alternative? You guys just push all your shit directly into release?
21
u/Orio_n 1d ago
Each feature gets a separate branch whats so controversial about this? Op is unemployed for sure
→ More replies (2)
28
u/50_procent 1d ago
This feel like a joke a llm would make. It does not really make any sense but it contains some random programming terms/scenarios so then its humor?
→ More replies (6)4
22
u/HallAltruistic519 1d ago
How TF is this still a problem when we have the "Squash commits and delete source branch on merge" checkbox? Are y'all restarted
→ More replies (12)
7
u/deadmazebot 22h ago
a good team manager takes responsibility of the team
and many workers would be bad managers
this offloading of work, then saying the AI did it, is still on that worker to review and approve the work they are passing off
but they are crap managers that have self promoted themself to a manager not understanding what they are doing
so just like a standard manager
33
u/WilmaTonguefit 1d ago
I'm still very selective about what I let AI do. Fix my method to remove potential memory leaks? Fine. Push to git? FUCK NO
17
→ More replies (23)1
u/Messy-Recipe 1d ago
git push& all similar/wildcarded things went on my blacklist immediately when we got claude code licensesthat said it's very efficient at doing complex commit reworks & reorders. I've always been a stickler for like, having each of my commits being an independent & coherent unit of work that is fully functional on its own, even if there are several in a branch. and I chronically swap tasks and like to do multiple things at once
so I make extensive use of fixup+autosquash, amend, multiple local sub-branches & cherrypicking, reordering things in history etc. and having that kinda stuff in my global instructions then telling it to do it actually works surprisingly well, I guess because it's something with a deterministic / clearly-correct desired end state
only locally of course, fuck if it gets the chance to mess with anything I dont have in my local reflog. But it's nice to be able to just vaguely be like "update that commit with the fix for XYZ, split off the changes for THING into a new commit but stick it here in the history since thats the logical progression, then fixup the remaining commits with ABC' and it just does it, no multi-line editing a big list of commands to then chain together
6
u/EricOrrDev 21h ago
Ya that's how it should be. EVERY feature gets their own branch prior to consolidating them into a feature release branch. What bugs me is not eventually archiving them into tags, I hate having a bunch of old branches.
→ More replies (5)
20
u/Ok_State5255 1d ago
I used to be the release lead for a major company. We had 16 developers split over 4 teams going into on production org.
The amount of ignorance surrounding Git was always astounding to me. I'm a pretty stupid guy (I once pulled a cast iron skillet out of the oven without remembering to grab a potholder. That was...painful), but you really only need to remember like 8 commands to do 99% of the work.
Nope, instead we have shit tools like Copado and Autorabit because people believe it's easier to point-and-click your way through. And I would have to clean up the inevitable messes.
Watch a 30 minute youtube video. Fuck up a commit...okay! You can revert it. Fuck up your branch? Start a new one and recommit!
It's designed to be easy. Somehow we all lost sight of that .
9
u/Groentekroket 1d ago
What is wrong with a GUI for Git? I always use the IntelliJ Git interface and 1 only need to use the CLI like once a year. Everybody squashed their branches and rebases on main. We make sure we don’t pick up stories that interfere with each ofher and we never face any problem.
3
u/visualdescript 1d ago
If you're squash merging, what's the point of rebasing on main, just merge main in whenever you need to?
6
u/Dancing7-Cube 1d ago
this drives me nuts lol, sometimes I'll get a stickler that refuses to approve until I clean up my commits, even though it squashes
like who cares, unless the PR is 10k lines, read the diff, the commits are basically just checkpoints in case my laptop SSD randomly dies
1
u/LegendaryMauricius 1d ago
git conflicts can be painful when they're with main, with several other feature branches already being merged there.
2
u/visualdescript 1d ago
How does rebasing make the conflicts any easier, you're still going to have to resolve them
→ More replies (2)3
u/Foorinick 1d ago
I mean, I've been trying to learn how to git properly but thw only place i found digestible information was unironically by asking ai on how to do it properly, but even then there are so many different things you have to understand and git barely explains or links anything to explain how one might unfuck themselves
1
u/awesome-alpaca-ace 6h ago
Once you understand commits, their hashes, resets, merges, cherry picks, pushes, pulls, diffs, and branches you are pretty much there. Of course you can do so much more too.
2
u/dylanzt 18h ago
When I was in industry, I was never a great engineer. But I spent half a day learning the internals of git and it was probably the most valuable thing I ever did for my career. It's genuinely shocking how poorly people understand it, considering how much they have to interact with it.
1
1
u/LegendaryMauricius 1d ago
git command is definitely designed stupidly though. The system should be easy, but it's also easy to end up in a git specifics rabbithole because something got fucked up either by a bad command or some remote communication bug.
1
u/awesome-alpaca-ace 6h ago
Most commits stay in git even when you do a hard reset. I forget how to get them since I usually note the commits before a reset, but you can find them and reapply them. I think it is quite hard to lose a commit, but I'm not real sure...
1
15
6
u/akshay-nair 1d ago
With commit messages like:
Adds whatever feature
...10 lines describing what the 5 lines of diff do.
1
5
u/dallenbaldwin 1d ago
10, 1000 line PRs are much easier to hand review than 1, 10,000 line PR, even if it feels like it takes longer...
3
u/CM375508 1d ago
... That's a methodology problem not an ai problem.
Even hand drawn code should follow gitflow
Features to a develop branch. Release cut to main.
But yes. Ai having git control will burn you sooner or later.
14
1d ago
[deleted]
5
u/razor_train 1d ago
I'm using Claude for some code generation, but it is absolutely forbidden to do any git command that changes anything. It's also forbidden to run the test suite since burning tokens for that is epically stupid. Granted I'm a dev team of one (human). My coworker challenge is that he developed massive piles of utter shit code, then git committed them all in one go (then took early retirement and left me with the dumpster fire).
→ More replies (11)3
u/LegendaryMauricius 1d ago edited 1d ago
Do you deny such commands with some settings? I actually told it in the .md to never use git commands and rather 'remind' me of doing them myself. I know the risks, but it was more of my preference. Sadly it lately started to use them and apologize to me after the fact, although it's usually commands that help it understand the code.
2
1
u/razor_train 21h ago
If you're finding that it randomly decides to do things on its own despite guardrails then I've got another level of stuff to worry about. (edit: undercaffeinated)
3
u/Voidsheep 1d ago
Recent AI models are capable of producing perfectly fine pull requests for plenty of software, in some cases better than decently skilled human developers.
I'm not advocating for not reviewing the code you ship, but if you are going to use AI for software development, not letting it create branches, commits and pull requests seems like a pretty arbitrary line to draw at this point.
1
u/Big_Action2476 1d ago
Exactly! It is so cool that I don’t even have to think anymore.
/s (added because I am afraid…very afraid)
1
u/charactervsself 1d ago
Do you spend a lot of time thinking about git commands currently?
1
u/Big_Action2476 1d ago
lol no. Been using git for 15yrs, that is just baked in. I don’t use ai for anything other than checking my proposed architecture against the docs (that I have already read) to find gaps
→ More replies (4)1
u/--LordFlashheart-- 1d ago
I will admit, commit messages are the bane of my existence. So I've a short skill directing my agents what I want in my commit messages and how long I want them. So I will just say commit and get it done. I will also ask it to make a branch from the JIRA ticket. But I would never make a push with an agent, no way
1
u/charactervsself 1d ago
Git commands are the most mundane and unimportant steps in the development workflow. The important parts are good requirements and validation. You’re behind the times, wake up or be left behind.
→ More replies (4)1
2
2
2
u/a3dprinterfan 1d ago
Before GH copilot, we had 17 feature branches per release, and now we have slightly more branches... What is the joke?
2
u/lachlanhunt 1d ago
I would much rather 17 small PRs to review than 1 mega PR. With each PR focussed on a small, somewhat independent, piece of the whole, that makes review a lot easier. GitHub stacks make this flow a lot easier now.
2
u/SeparateAdvisor526 15h ago
This is the one time I side with AI. It does a good job breaking things down into feature branches. I have coworkers that have huuuuge branch with so many changes and the merge is a nightmare
2
u/rabbit_wizard 15h ago
If they're in stacked that's good. If multiple branches aren't stacked they can cause a lot of merge conflicts
1
4
u/WingZeroCoder 1d ago
I can relate to this…
But at least now they’re finally not working directly on main? 🫠
2
2
u/Jastafool 1d ago
ew boi, copilot?
Use chatGPT/codex, Claude, LITERALLY ANYTHING ELSE
1
u/Worldly-Stranger7814 1d ago
Grok?
1
1
1
1
1
u/DontForgetWilson 1d ago
There was a point in time i would have killed to have only 17 feature branches to merge for a release. I probably would have killed to only have 30 branches to merge. Luckily, that PTSD inducing time in my life is no more.
1
u/Procrasturbating 1d ago
I had a PR will 150 modified code files, large changes get pushed to main directly without a PR because I thought I would let AI do a deploy. I had created a PR, and it just pushed the code around it completely. Le sigh.
1
u/pipedreamSEA 1d ago
Y'all have coworkers?
I'm often the lone dev for a project. And I still properly create a bug or feature branch and send PRs, which I often review myself, for traceability. I'm trying to do away with release branches and just use tags on master / main but I'm just not that confident in my abilities
1
u/Foorinick 1d ago
I think the right way to act is to indeed not trust yourself and do stuff by the book, I've started doing that in my personal projects and led to me having way less bugs and concentrate better on what I'm actually supposed to be working on, along with making it easier to see why something was changed and if i should be allowed to change it again to fix something else
1
u/awesome-alpaca-ace 6h ago
TDD and looking at the diff before commit has made my most recent project way more successful than my last attempt at this
1
u/BoBoBearDev 1d ago edited 1d ago
I don't get it. Why you care when you only merge PRs? One PR per atomic sub-task. As long as they don't split the PR into tiny pieces like, one PR per typo correction. It is just merging PR.
You shouldn't know how anyone git. You shouldn't trust them either. Enforce fork, so they can't pollute the main repo. And squash merge the PR, so they don't sneak in some secrets in the git history. If there is a leak in the commit history of PR, you can delete the PR without fixing git history. Do not trust the PR creator to remove leaks in the git history, think it as open source project, you can't control them.
1
u/Daddy-Mihawk 1d ago
I literally thought what’s the use of rebase, used only once in last 2 years, and now still don’t remember what it does
1
1
1
1
1
u/LegendaryMauricius 1d ago
I mean 17 features for a published release makes sense. However I can imagine AI creating dozens of branches for smaller changes which become annoying to later deal with.
1
1
u/DumbButtFace 1d ago
The marketing department started using git to deploy websites and things like that at my job. It’s complete chaos and clearly everyone is telling Claude to “just do it” over its protests
1
u/TheRapie22 1d ago
my team manages to create 17 release branches for a single release... without ai
1
u/ModusPwnins 3h ago
We have long had that many feature branches for all our releases. It's fine, as long as each one is reviewed and QAed by actual humans who know what the fuck they're looking at.
991
u/purpleburgundy 1d ago
I WISH all of my coworkers broke down their tasks into dedicated feature branches. Merge them all into release branch, this is business as usual stuff, what's the controversy here.