There are some basic skills that are easy if you learn when you are young but can be baffling if you have to master them later in life. For example, driving a car with a manual transmission can seem to be perversely difficult to somebody who learned to drive on an automatic. However, the challenge of “driving stick” pales in comparison to mastering the git command line interface if you didn’t grow up with git. In this article I’ll describe how I harnessed OpenAI’s GPT-3 to generate git commands from English language descriptions.

What’s great (and not so great) about git

Git is a foundational technology and a brilliant contribution to modern software development. It also has a set of commands which can seem to be purposely haphazard and inconsistent.

“With all that there is to like about Git, I have always been so frustrated at the lack of clarity in the command-lines for doing anything beyond the simplest action. Heck, even the simplest actions are harder than they need to be.” from Why the heck is git so hard by Daniel Eklund.

I came to git late in life. I had used a variety of code control / versioning systems in my career at IBM, including the venerable CMVC and Clearcase, which was reasonably accessible but still esoteric in the manner of IBM software from that era. Neither of these systems prepared me at all for the wonderful world of git.

Faced with the challenge of git syntax, I did what any self-respecting software developer in the 21st century would do. I saved my most common git commands in a Word document, along with a description of what the commands did. When I needed to repeat a particular git incantation I could look in this Word document to see if I had done it before and try to figure out the syntax. Sounds awesome, right? Unfortunately, I now had the problem of keeping this document in sync between my personal and work environments, and as it got bigger I ran the risk of losing track of the more basic git commands.

If only there were some way to replace my git cheat sheet with an intelligent assistant that could translate my English language descriptions into git commands…

#git #gpt-3 #python #cheatsheet #github

Replacing my git cheat sheet with GPT-3
2.15 GEEK