A common scenario for new programmers: git and vim

git is a command-line version control system. Version control means taking snapshots of files you’re editing at different stages of development. It’s almost like an undo-redo program with lots of extra features to navigate through your timeline of snapshots. Each snapshot is called a commit.

New programmers are encouraged to learn git early because team programming projects basically require the use of some kind of version control, and git is one of the most widely-used version control systems in the software industry today.

It’s also a good idea to use version control when doing solo work. I’ve found that the git workflow I use helps me prioritize paths of development and break up my work into digestible chunks. (Tangentially, version control is becoming increasingly popular among writers and other non-programmer vocations.)

Using git

My git workflow looks like this:

  1. Use my preferred text editor to make changes to one or more files in my project and save them normally
  2. Ask my terminal to list the changed files with
    $ git status
  3. Add changed files to my ‘stage’ to be included in my snapshot with
    $ git add [filename]
  4. Commit my changes with a message using
    $ git commit -m "Descriptive message here"

But if you’re a first-time git user with little experience on the command line, you may try take a snapshot of your progress with this command:

$ git commit

Sounds simple right? What you don’t know is that the default behavior for git commit is to launch your terminal’s default editor so you can write the mandatory commit message, since you didn’t include a message with the -m flag like I did.

Remember earlier when I said that your terminal’s default editor is probably vim? Here’s the fun part.

Surprise, it’s vim!

Imagine being a freshman computer science student. You’ve been using the command line for a few months now but only in a few limited contexts. You’re far from comfortable with the teeny tiny text on the scary black screen.

Right now you have a deadline on a group project. This is your first time working with git because your annoying group leader (who made her the boss?) is making you use it. You don’t understand why she can’t just let you learn what you need for the project so you can get a decent grade.

She went through her fancy workflow but you just couldn’t deal with her annoying patronizing-ass voice so you zoned out the whole time. You’re already in lectures all day! Why do you need another one that won’t even count toward anything?

So you decided you’ll just do the project and figure out the git bullshit when you have to turn it in. Which is now.

You are here:

Screenshot 2017-05-28 17.58.13

You’ve typed this:

$ git commit

When you hit Enter you see this:

Screenshot 2017-05-28 17.58.22

Wait, what?

What you’re supposed to do

If you expected vim to open, you’d know you have to

  1. Hit i to switch to INSERT mode
  2. Type your commit message
  3. Hit ESC to switch to COMMAND mode
  4. Type :wq and hit Enter to save and exit

What you actually do

But you’ve never heard of vim. You didn’t expect the whole screen layout to change. And now you’re hitting ESC ESC ESC and CTRL-Z and then you end up back where you were before with this message:

$ git commit

[1]+  Stopped                 git commit

You try it again

$ git commit

And are shown this:

Screenshot 2017-05-28 18.07.25


Now you’re panicking. You feel a knot in your throat. Your eyes are starting to sting.


You start frantically Googling… etc., etc.

An hour later you’re in tears, emailing the files to your group mates, trying to ignore the shame you’re feeling because you couldn’t get stupid git to work and everyone else could.

A hazing ritual

Like I said in my previous post: programming has lots of these hazing rituals. My first year studying CS, it took me four months to figure out how to open an existing project in Eclipse.

I’ve bawled my eyes out and torn my hair out and thrown things across the room. And then eventually you realize you just misread some small thing and it’s actually not that hard. But you still feel kind of superior for having figured it out yourself.

Yeah, maybe that isn’t the healthiest attitude to maintain. Programmers are weird.

Published by


Software engineer, armchair novelist

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s