Essential Git Commands for Junior Developers
2026-04-26 6 min read
Git is the most widely used version control tool in software development. If you're starting your career as a developer, mastering these commands will save you many headaches.
1. Initial Setup
The first thing to do after installing Git is to configure your identity:
git config --global user.name "Your Name"
git config --global user.email "you@email.com"2. Clone a Repository
To download an existing project to your machine:
git clone https://github.com/user/repo.git3. Daily Basic Flow
These are the commands you'll use literally every day:
# Check the status of your files
git status
# Add files to the staging area
git add . # all files
git add src/file.ts # specific file
# Commit changes with a message
git commit -m "feat: add login form"
# Push changes to the remote repository
git push origin main4. Working with Branches
Branches are fundamental to avoid breaking main code:
# Create and switch to a new branch
git checkout -b feature/new-feature
# List all branches
git branch
# Switch branch
git checkout main
# Merge a branch into the current one
git merge feature/new-feature5. Get Team Changes
# Download latest changes without merging
git fetch origin
# Download and merge latest changes
git pull origin main6. View History
# View all commits
git log --oneline --graph
# See what changed in a specific commit
git show abc12347. Undoing Changes
# Discard changes in a file (caution: irreversible!)
git checkout -- file.ts
# Remove a file from staging without losing changes
git reset HEAD file.ts
# Temporarily save changes without committing
git stash
git stash pop # recover them laterCommit Message Convention
Use Conventional Commits to keep your history readable:
feat:new featurefix:bug fixdocs:documentation changesrefactor:code refactoringchore:maintenance tasks
Want to practice? Try our slug generator or UUID tools for your projects.
UUID Generator