
Photo by the author
# Entry
I’ve heard stories about Claude Koda Or Cursor “database deletion” or wiping out files that people spent days building while encoding vibrations. The real problem is usually not the artificial intelligence (AI) itself, but the lack of version control. If you don’t utilize Gitall your work exists in one breakable state, and one bad refactor can destroy everything you’ve done.
I even asked Claude to “set up Git and make major changes”, but he mostly ignored my request to keep the application running. This means you can’t really rely on AI to track changes and restore your app if something goes wrong.
The purpose of this article is to address this concern. Provides a beginner-friendly, background-free guide to integrating Git into your vibration coding workflow. By learning basic Git commands, you’ll be able to create secure snapshots, perform effortless rollbacks, manage pristine branches, and set up automatic GitHub backups. Make progress without stress.
# 0. One-time setup (tell Git who you are)
Go to the Git website and install Git based on your operating system. Then open a terminal and type:
Configure the name and email address that Git will log in the commit metadata:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
These settings associate your commits with your identity, which helps Git properly track your work.
# 1. Start tracking your project
Before typing claude in terminal, navigate to your project folder and run the following command to initialize your Git repository:
Git will then start tracking your changes.
# 2. Save your first version (two steps)
After making some changes, you need to save them to Git.
First, plan everything you’ve changed, then commit it by sending a brief message describing what you’ve done:
git add .
git commit -m "first commit"
Recommendation git add . means “include all changed files” and git commit saves a snapshot of your message.
You’ll repeat this often as you work and ask the AI to create fresh features:
git add .
git commit -m "describe what you changed"
# 3. Push to GitHub
I highly recommend creating one GitHub account and then setting up a fresh repository there. Copy the repository URL which will look like this: https://github.com/yourusername/my-project.git.
Then link your local folder to this repository and push the changes using the following commands:
git branch -M main
git remote add origin https://github.com/you/my-project.git
git push -u origin main
The first time you press Git, it may ask you to log in; utilize your GitHub username and personal access token (PAT). You can create a PAT by going to GitHub → Settings → Developer Settings → Tokens. Once you enter your credentials, they will be saved in your system’s credentials manager, so for subsequent uploads you can simply utilize git push.
# 4. Daily coding loop
Here is the cycle you will utilize every day:
- Make
- Save your changes to Git
- Send them to GitHub
git add .
git commit -m "describe the change"
git push
If the project has been changed elsewhere (another person or another computer), pull first to get the latest version:
Then continue working as usual.
# 5. Create a safe and sound playground (branches)
Branches are just separate workspaces, so you don’t interrupt the main one. Create a separate one for each feature or patch, do your work there, then connect when you’re ready.
git checkout -b feature-login # create + switch to a fresh branch
# ...code, code, code...
git add . # stage your changes
git commit -m "add login page" # save a snapshot on this branch
git push -u origin feature-login # publish branch + set upstream
Once it’s ready, link it via a pull request on GitHub (click “Compare and Pull Request”), which is best for review and history.
Or connect locally:
git checkout main # switch to main
git pull # get latest main
git merge feature-login # bring your branch into main
git push # upload updated main
Optional cleanups (after linking):
git branch -d feature-login # delete local branch
git push origin --delete feature-login # delete remote branch
# 6. Quick solutions to common problems
To check the status of your repository, run:
If you’re not ready to commit changes but need to change tasks, you can hide the changes and recover them later by using:
Later you can restore hidden changes with:
If you want to undo your last commit without losing your files (so you can make changes and commit again), utilize:
To discard local changes to a specific file and restore it from its last commit, run:
If any of these commands seem risky, you can always stick to a basic workflow git add, git commitAND git push to send changes.
# 7. Minimal cheat sheet
To set up a fresh project for the first time, initialize Git, save the first snapshot, set up a master branch, connect to GitHub and press:
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/you/my-project.git
git push -u origin main
In your daily work, download the latest changes, schedule them, confirm them with a clear message and press:
git pull
git add .
git commit -m "your message"
git push
For a fresh feature or fix, create and switch to a branch, make your changes, commit and publish the branch to GitHub:
git checkout -b feature-name
# ...edit files...
git add .
git commit -m "implement feature"
git push -u origin feature-name
# Abstract
Think of your project as a notebook:
- git add: Select which pages you want to save (select changes)
- git commit: Take a picture of these pages (save a snapshot with the message to remember what happened)
- git push: Upload this photo to the cloud (upload your saved work to GitHub)
- gitpull: Download the latest photo from the cloud (download the latest work that you or someone else has uploaded)
The workflow is basic:
- add → confirm → press
- pull → add → confirm → press
This covers about 90% of what you need to know about Git. Everything else – such as branches, merges, stashes, resets, etc. – are just additional tools that will come in handy as your projects grow.
You don’t have to memorize every detail about Git to be productive. As you continue to build, you will become more familiar with it naturally.
If you only remember this, everything will be fine:
git add .: Select my changes.git commit -m "": Save snapshot.git push: Upload.git pull: Download fresh updates.
Once this process becomes intuitive, using Git will no longer be daunting; it will simply become a natural part of your work.
Abid Ali Awan (@1abidaliawan) is a certified data science professional who loves building machine learning models. Currently, he focuses on creating content and writing technical blogs about machine learning and data science technologies. Abid holds a Master’s degree in Technology Management and a Bachelor’s degree in Telecommunications Engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.
