HACKER Q&A
📣 ThinkBeat

Could somebody use GPT make Git super easy to use?


A lot of amazing thingss are being done with AI now.

Could someone train GPT to automate most of Git workflows and make the rest super easy?

I would think if you can use it to code an entire whole application, it can do Git.

I would try it myself, but I have no idea how to use the various AI tools.


  👤 turtleyacht Accepted Answer ✓
I think it's possible. Ask GPT to

  * Show the git command to set up a repo
    named "test," with placeholders for
    my username and password.
  * Show the git command to create a new
    branch, where it starts with story ID
    JIRA-1234.
  * Show the git command to stage and push
    my changes.
  * Show the gh command to create a pull
    request.
  * Show the git commands to switch to main
    and rebase my changes from branch X
However, notice how GPT only provides the mechanism of execution. We still have to vet and run it ourselves.

In the future, we'd probably want these:

  * Onboard me with dev creds
  * Pick a story off the backlog and create
    a PR using its description
  * Add me as a reviewer to your changes
  * Ask the team where to eat. Break ties.
    Voting ties, I mean.
Some other interesting ones:

  * Break up this service into multiple
    microservices.
  * Create a test suite for the changes in
    this PR.
  * Convert this repo from Java to Rust.
  * Translate every hardcoded string in
    this repo to Thai.
  * Follow up with everyone still needing
    to approve all changes this week.
  * Suggest root-cause for the outage last
    week.
Extra-domain questions would be nice:

  * What investment strategies will
    maximize my return this week?
  * How is the company doing financially?
  * Are folks happy to work here?

👤 eimrine
Do you think that talking to git like to a human will be easier than talking to git using git language? I would rather set AI in such a way to be able to describe any command I type.

👤 mitchellpkt
I haven't had a chance to test it personally, but I think this is a main premise of GitHub's Copilot CLI product. Quoting below from https://githubnext.com/projects/copilot-cli

> Copilot for CLI provides three shell commands: `??`, `git?` and `gh?`:

> `??` is meant as the general-purpose goto for arbitrary shell commands. It will compose commands and loops, and throw around obscure find flags to satisfy your query.

> `git?` is used for searching specifically for git invocations. Compared to ?? it will be more powerful at generating Git commands, and your queries can be more succinct when you don't need to explain that you're in the context of Git.

> `gh?` combines the power of the GitHub CLI command and query interface with the convenience of having AI generate the complicated flags and jq expressions for you.


👤 kingkongjaffa
Is there a word for “bad-pattern” when it comes to some applications that will make us dumber and lazier?

On one hand git seems to be confusing and hard to grok.

But on the other hand I think once you get it it helps to enforce good coding practices, small working commits, good commit msgs, helps to understand the codebase better. I think all of the side effects of git are better in my brain than having a slightly better abstraction layer to make git do more magic for me.


👤 Am4TIfIsER0ppos
Will it refuse to use the master branch because it's racist?

👤 johntiger1
Yep, I'm building a commit generator using GPT: https://github.com/johntiger1/gpt-cli