Never Lose Your Vibe Coding Progress Again With Git

Learn how to save your vibe coding progress with Git so you do not lose your work. You’ll practice eight practical Git commands, create your first commit, use a feature branch, merge changes back into main, and add Git rules for your AI coding assistant.

  • Intermediate
  • 7 steps
  • 1 resource
  • By The Rundown University

Resources 1

Start from the exact file used in this guide instead of rebuilding it from scratch.

Unlock with Pro

$29 a month, cancel anytime

Step by step 7 steps

  1. Step 1 of 7

    Install Git

    Go to git-scm.com.

    • On Windows, download the installer.
    • On Mac, follow the instructions to install Git with Homebrew.

    Homebrew and Git are both safe, open source libraries that have been around for decades.

    Verify the installation by pasting this into your terminal and pressing return:

    git --version

  2. Step 2 of 7

    Add Git to your project

    Open your code editor and create a new folder with a basic HTML file in it. You can download the example file from the resources section if you’d like.

    Open a terminal session in your code editor. Type this command and press return:

    git init

    You can now track changes in this repository.

    💡 Pro tip: Ask your AI coding assistant to create a README.md that explains your project. This will come in handy if you upload the project to GitHub.

  3. Step 3 of 7

    Write your first commit

    A commit is a snapshot of your code at a specific moment.

    • A unique ID, such as abc1234def5678
    • A message describing what changed
    • An author
    • A timestamp

    Before writing your commit, add your changes to the commit:

    git add .

    Now write your first commit:

    git commit -m 'first commit!'

    first-commit

    Your changes are now saved and added to your main branch.

  4. Step 4 of 7

    Create a feature branch

    When you’re coding, it’s important to create new branches for new features. This practice can save headaches and improve your coding agent’s context.

    Create a new branch called “feature-1”:

    git checkout -b feature-1

    Any commits you make now will be saved to the feature-1 branch.

    To see a list of your branches and your current branch, run:

    git branch

    git-branch

    To switch branches, use:

    git checkout [branch name]

  5. Step 5 of 7

    Add a feature to your main branch

    Now save your new progress to your main branch.

    First, add some changes to a file in your new branch. Save them with a commit.

    Switch to your main branch:

    git checkout main

    Merge your feature branch into main:

    git merge feature-1

    git-merge

    Your changes are now saved to your main branch.

    💡 Pro tip: Every commit and merge has a unique identifier that you can see with git log. To undo a merge, you can use git reset [commit hash].

  6. Step 6 of 7

    Make AI use Git for you

    When you start a new project, add this simple prompt into your context file. For example, add it to CLAUDE.md if you are using Claude Code.

    # Git Rules
    1. Create feature branch: `git checkout -b feature-[name]`
    2. Commit after each logical change: `git commit -m "Add [what you did]"`
    3. When done, ask: "Ready to merge feature-[name] into main?"
    4. Wait for approval before merging
    5. Never commit directly to main

  7. Step 7 of 7

    Optional: Save your code to GitHub

    • To save your code to GitHub, install it to your terminal and then log in with gh auth login.
    • Create a new repository on github.com. Copy the commands into your terminal and press return.
    going-further

    Any time you want to save a branch in the cloud, use this command:

    git push origin [branch name]

That's the whole workflow

Mark it complete to keep your progress. The background follows.

Keep learning with Rundown Pro

Guides stay free. This is what Rundown Pro adds:

  • Every course and recording
  • The Rundown Certified Operator program
  • Member perks

$29/mo, cancel anytime

Background and context

Who This Is Useful For

  • Vibe coders who skipped CS class
  • Claude Code users who want to save tokens
  • Cursor users who want to save their progress

What You Will Build

You will build a Git-tracked coding project that can preserve progress through commits, feature branches, and merges. You will also create reusable Git rules for your AI coding assistant.

  • A project initialized as a Git repository
  • A first commit saved to the main branch
  • A feature branch called feature-1
  • A merge from the feature branch back into main
  • A reusable AI context prompt for Git workflow rules
what-you-will-build

What You Need

  • A computer with terminal or command line access
  • A text editor or IDE, such as Cursor
  • Git installed on your computer
  • A basic HTML file or the downloadable example file

Going Further

  • After you have the local Git workflow working, you can save your code to GitHub, create a new repository, and push branches to the cloud with git push origin [branch name].