Small practice repository used to learn Git and GitHub basics.
This repo is not a real project. It is a sandbox that I used to understand:
- How to create a Git repository
- How to track files with
git addandgit commit - How to create and merge branches
- How to connect a local repo to GitHub and push changes
Commands used in this repo include:
git initto start a new repository in theCatsfoldergit statusto check which files are untracked or modifiedgit addto stage changesgit committo save a snapshot of the staged changesgit branchandgit checkoutto create and switch branchesgit mergeto bring changes from a feature branch back into the main branchgit remote add originandgit push -u origin mainto send the repo to GitHub
cats.txtsimple text file that I edited several times to see how Git tracks changes over time
README.md
This repository was created to practice essential Git and GitHub commands including:
- Initialising a repo
- Adding and committing files
- Creating and merging branches
- Viewing log history
- Connecting to a remote GitHub repository
- Pushing changes to
main
| Concept | Status |
|---|---|
| git init | ✔ Learned |
| git add / commit | ✔ Practised |
| git branch / checkout | ✔ Completed |
| git merge | ✔ Completed |
| git push / pull | ✔ Working fully |
cats.txt — updated multiple times to test version control.
- Create more branches and merge changes
- Try rebasing and resolving merge conflicts
- Start a real project repo using this workflow
This repository began as a practical exercise in learning Git and GitHub using a simple file cats.txt. It is now a reference guide for understanding Git, tracking changes, branching, merging, and pushing to GitHub. This README contains all my Git notes so I can always return here when I need a reminder.
- Practice using Git commands
- Learn how commits and branches work
- Understand how to connect local Git to GitHub
- Store notes for future reference
- Experiment safely without worrying about breaking anything
Main file used for testing: cats.txt
Git = a time machine for projects.
- Every save is a snapshot (commit)
- Git remembers every version
- You can return to old versions anytime
- You can work on different versions using branches
- You merge branches back together when finished Git does not auto-save - you choose what to record
git status # Check what changed
git add <file> # Stage changes
git commit -m "" # Save snapshot
git push # Upload to GitHub
git pull # Download changes from GitHub
Once I know this cycle, I can already use Git like a developer.
git config --global user.name "z******s"
git config --global user.email "******.******@gmail.com"
git config --global user.name # verify
git config --global user.email # verify
git init
git status
git add cats.txt
git commit -m "First commit: added cats.txt"
git log
git log --oneline
git log --oneline --graph
git branch test-branch
git checkout test-branch
# edit file + commit inside branch
git commit -m "Added branch-specific line"
git checkout main
git merge test-branch
# remove branch if finished
git branch -d test-branch
git remote add origin https://github.com/z***e**s/cats.git
git remote -v
git branch -M main
git push -u origin main
git push
| Branch | Purpose |
|---|---|
| main | stable version |
| feature/test-branch | development/experiments |
Flow:
git branch new-idea
git checkout new-idea
# work + commit
git checkout main
git merge new-idea
git branch -d new-idea # optional
| Problem | Cause | Fix |
|---|---|---|
| not a git repository | Git not initialized | run git init or cd into repo |
| repository not found | wrong remote URL | git remote set-url origin <url> |
| changes not appearing locally | local repo outdated | git pull |
| VS Code sees changes but terminal doesn't | different branch active | check git branch + VS Code bottom-left |
- Open folder in VS Code
- Click Source Control
- File appears under CHANGES
- Stage using
+ - Write commit message → press Ctrl + Enter
- Click Sync/Push icon to upload to GitHub VS Code = Git commands but with buttons.
# setup
git config --global user.name "Name"
git config --global user.email "Email"
# workflow
git status
git add .
git commit -m "message"
git push
git pull
# branches
git branch
git branch new
git checkout new
git merge new
# github connection
git remote add origin <url>
git push -u origin main
- Create more branches & merge them
- Cause merge conflict on purpose + solve
- Try
git rebase - Clone repos using
git clone <url> - Start a real C / Python / Arduino/ Security repo
This README exists so I never forget my Git fundamentals.
If I ever get stuck - return here.