As a backend engineer who’s spent more than a decade keeping track of sprawling code bases, I remember the first time someone told me about Git and GitHub. My project files lived on my laptop, I copied them into zip archives when I wanted backups and emailed code to teammates. It worked, but it was messy. When I finally learned Git, it felt like discovering a magical notebook that remembers every change you make and lets you rewind, branch off an idea, experiment and merge it back together without losing anything.
This post is the one I wish I’d read back then, an informal and friendly walk-through of Git and GitHub with examples and practical tips.
What is Git and why do vibe coders need it?
At its heart, Git is software that tracks changes in files over time. Going more technical, it is a free and open‑source distributed version control system, designed to handle projects of any size efficiently.
Instead of a single central server storing your code, Git is distributed: when you clone a project you get the entire history on your machine. Because everyone has the full project, there’s no single point of failure and collaboration becomes very resilient.
Git’s distributed nature also allows flexible workflows. You can have multiple independent branches, experiment in isolation and merge changes later.
That means you can create a branch for an idea, commit several times, switch back to your main branch, apply a patch, then merge your experiment when it’s ready to go.
These capabilities aren’t just for large teams, solo vibe coders benefit from being able to roll back mistakes, save checkpoints and share code with future collaborators.
How Git works under the hood
When you git init
a directory, Git creates a hidden .git
folder that stores metadata and snapshots of your files. Every time you make a commit, Git saves a snapshot and a reference to its parent commit (think of it like a tree of changes). Because each commit points to the one before it, you can travel back in time or examine how the project evolved. A branch is just a logical separation; creating and deleting branches is inexpensive.
Git repositories live locally on your computer, but they can also be pushed to remote repositories. Remotes are just other copies of the same history, often on a server or a hosting service like GitHub. Synchronising means pushing your commits to a remote and pulling new commits others have made. Because Git stores complete histories, you can work offline and merge changes later.
Essential Git commands
Below is a handy reference of common commands. These phrases show up in countless tutorials and job postings. Now you’ll know what they mean.
Notice how the descriptions are succinct. Git commands deserve memorable names, but there’s nuance behind each. In practice, you’ll often chain these commands together: create a branch, make edits, stage and commit, then push your branch and create a pull request on GitHub.
GitHub: the social layer on top of Git
Once you’ve learned Git’s mechanics, you need a way to share your work. GitHub fills that role. The GitHub documentation calls it a cloud‑based platform where you can store, share and collaborate on code. When you store code in a GitHub repository you can showcase it publicly, track changes over time, invite others to review your code and collaborate.
You can think GitHub as a Git-as-a-Service, but with a toolbox around, that we will see in a sec.
A GitHub account is free for public and private repositories. After you sign up, you can create a repository via the web interface or gh
CLI, invite collaborators and set permissions. Many vibe coders start with GitHub because it’s the default home for open‑source projects and it integrates with countless tools like Lovable.
Why GitHub matters
GitHub provides features beyond just storing code:
Social coding: People can follow repositories, star projects and fork code. Forking lets you copy a repository to your own account to experiment; later you can send improvements back via a pull request.
Issues & discussions: Each repository has an issue tracker where you can report bugs, suggest features or ask questions. It’s like a to‑do list shared with contributors.
Pull requests: A pull request (PR) is a proposal to merge changes from one branch into another. Pull Request is a way to communicate changes to a branch so collaborators can review and discuss before integrating them. When you open a PR, your teammates can comment on the diff, approve it or request changes. Once everyone is happy, you merge the PR and your feature becomes part of the main branch.
Actions & automation: GitHub Actions allow you to run automated workflows like tests, deployments, code formatters whenever you push or open a PR. This keeps your code quality high without manual effort. The concept behind GitHub Actions is Continuous Integration (CI).
GitHub Pages: You can host static websites directly from a repository. Many developers use Pages to host personal blogs or project documentation.
Copilot: GitHub Copilot offers AI‑powered code suggestions. It’s like pairing with an AI partner that’s read every open‑source project. (While Copilot is optional, it’s popular with vibe coders exploring new languages.)
The right way to do: Pull Requests
Even though you might be able to commit directly into the main
branch, this is not a good ideia.
When you work in a team, your teammates gotta see your changes before merging it to main. I know, it might sound scaring somehow (damn, they will see my code, what if they see a bug?) and actually that's the point of a PR: to avoid bugs and keep the entire codebase following the same standards.
Well, I work alone, I don't need this shit.
Nah, re-think it buddy.
Even though, in fact, there's no one to review your code, you might want yourself to make a double-check.
Trust me, we often think we covered everything that we need to implement and no more temporary information hardcoded in you code like your database credentials, but the reality is: failure is part of the human being, so no: you cannot assure you're good to go. Open the damn PR and review it, if it is everyhing is as good as you thought, it might take a few minutes only 😏.
Follow these steps:
Clone and branch: (
git clone
) After you clone a repository, create a new branch for your feature. Using branches keeps your changes isolated from the main code until they’re ready.Commit locally: (
git add, git commit
) Make small, meaningful commits with clear messages. This history helps reviewers understand your thought process.Push to GitHub: (
git push
) Push your branch to GitHub. Others can now see your commits and code.Open a pull request: On GitHub, click New pull request and select your branch. Describe what you changed and why. GitHub shows the diff and allows comments.
Review and discuss: Collaborators review your code, ask questions and suggest improvements. GitHub’s review system ensures quality and consensus. - Working alone? Review it on your own or use tools like CodeRabbit.
Merge: After addressing feedback, merge your PR into the main branch. Delete the feature branch when you’re done 🎉.
This process may feel formal at first, but it scales beautifully from one-person side projects to enterprise teams.
Backups (?)
If you already reached something good and your app is running smoothly, you don't want to lose the work you did so well when applying any other change, right?
You might have thought about some backup, right? “How do I make a backup copy from this code? Maybe creating another folder like my-wonderful-app_v2”.
To be honest that might work, but in a few days you would end up in a mess.
For that, Git offers us a feature called tag.
A tag is a snapshot (or a backup copy) of your current status and normally people name these copies in the format v1.0.0.
This format as 1.0.0
is known as Semantic Versioning.
I won't get deeper on it right now, but it worths to take a look.
To create a tag, go to your GitHub repository page and click in Releases, then Draft a new release:
Then entever the desired tag name in the “Select tag” dropdown and the target branch (the branch from where you're going to create the tag - normally main
)
A practical example: tracking a vibe coding project
Let’s walk through creating a simple project from scratch. Suppose you’re building a generative art sketch that makes colourful shapes to your favourite beat. You want to keep track of your progress and share it on GitHub. Here’s a step‑by‑step:
Install Git: if you're a Windows user, you might install it from Git's official site. If you use Linux, it is already installed and if you use Mac just type
git
and in the terminal and follow the instrcutions.Create a repository on GitHub: Log in to your account, click New repository, name it
vibe-art
, add a description and choose whether to make it public or private. Keep the option to initialise with a README.Clone locally: Open a terminal and run:
git clone https://github.com/your‑username/vibe-art.git
cd vibe-art
Build your project: Add your code files (for example
main.py
orindex.html
). Test your sketch locally.Stage and commit changes:
git add .
git commit -m "Initial generative art sketch"
Push to GitHub:
git push origin main
As initial commit, it is ok to commit directly in main, but this kind of commit is just the base structure of the project - avoid implementing features here right away.
After pushing, refresh your repository page and your code is there!
Iterate via branches: When adding new features, create branches:
git checkout -b colourful-backgrounds
# edit code, test
git commit -m "Add randomised background colours"
git push origin colourful-backgrounds
Open a pull request: On GitHub, go to the
colourful-backgrounds
branch and click Compare & pull request. Fill in a description of your changes. If friends help you review, they can comment and approve before you merge.
By following this pattern you keep the main branch stable while experimenting. Even if you’re the only contributor, branches and pull requests help you organise your thoughts and document why changes were made.
Best practices and pro tips
Write meaningful commit messages: A good commit message answers what and why. For example:
Add input validation to avoid crash on empty file
tells future you why that commit exists.Commit often, but logically: Don’t wait until the end of the day to commit everything. Commit after each logical change so you can revert specific parts if needed.
Use
.gitignore
: Before committing, add a.gitignore
file to exclude files like.env
, compiled binaries or your editor’s temporary files. You can find templates for different languages at gitignore.io.Don’t commit secrets: Never commit API keys or passwords. Use environment variables or secret management tools instead.
Explore graphical clients: While the command line is powerful, tools like GitHub Desktop (available for Windows and macOS) provide an intuitive interface, which can be good for beginners. There are also plugins for IDEs like VS Code.
Take advantage of GitHub’s ecosystem: Explore GitHub Actions to automate tests, GitHub Pages for hosting portfolios, and GitHub Copilot to brainstorm code. Many of these features have free tiers for personal projects.
Keep vibing, buddy! ✌🏻