9

I'm notoriously bad at Git. By that I mean I REALLY REALLY SUCK AT IT. And I have the curse of short memory and an even shorter ability to retain the how-to, muscle memory knowledge of things if too much time passes.

So, I was staring down the gullet of merging two separate repositories onto my local machine and then pushing the result to a remote server. Not having the benefit of someone else to bounce this off of, and always finding the usual Git docs too dense and obtuse, I turned to ChatGPT to help me sort it out.

Guys, where has this been all of my life? I know it's not perfect and it can make mistakes. I knew that going into it, so I made preparations in case this failed. BUT. IT. WORKED! I feel like it has put me into the Star Trek:TNG universe where I can say "Computer, do the thing." and it does that thing. Here's the prompt I used and which it answered perfectly.

"Play the role of a git coach. I have two git repositories. One is on Bitbucket. The other is on GitHub. The branch named "master" on Bitbucket has the latest code. The branch named "master" on GitHub needs to be updated to what's on the Bitbucket "master" branch. Please write the series of git commands that I will need to accomplish this."

Comments
  • 6
    Git add *
    Git commit
    Git push
  • 3
  • 1
    Learning git branching patterns will take you from a sr dev to a fucking god.

    I'm happy someone is at least getting some help, albeit from a questionable source, on becoming more proficient in git.

    Congrats!
  • 1
    @AvatarOfKaine Nope. That wasn’t it.
  • 3
    Git literally monopolized version control and is the one tool _everyone_ uses regardless of programming language. Surely someone had your problem before and asked about it on StackOverflow...

    https://stackoverflow.com/questions...
  • 0
    @Oktokolo I struggle with SO (despite my username). I overthink or misunderstand the solution offered and my success rate suffers. People responding get frustrated with my need to ask clarifying questions. What I like about ChatGPT is that I can revise my question as many times as needed to narrow the solution. It’s not perfect every time but nobody mocks me over my lesser understanding than they have. It just patiently refines its answers until I get what I need, either as a full answer or as a hint as to what I can do next. No ego.
  • 3
    @stackodev What normally makes StackOverflow great for this sort of question is that you don't actually have to ask it. Someone else already did years ago and thausands of people reviewed the question and its answer. In addition to ChatGPTs sermons, you get an actual human rating and normally also links to sources.
  • 0
    Get güd bitch
  • 0
    Yeah besides that being on stack overflow it's super simple especially if they have common history (e.g. fork).
    If they do not share history you need to merge the history now that is hard.
Add Comment