Git & GitHub Cheat Sheet for Job Seekers
The 40 commands that show up in take-home projects, pair-programming rounds and first-week onboarding across the U.S. and Canada, in one interactive dashboard.
$ git clone <url> $ git checkout -b feature/login-fix $ git add . $ git commit -m "Fix login validation" $ git push -u origin feature/login-fix # then open a pull request
What Git Commands Do Job Seekers Need to Know?
Git is the version control tool that tracks changes to your code on your computer, and GitHub is the website where you store and share that code. For most tech interviews and first-week onboarding, you need about 40 commands across seven groups: setup, basic workflow, branching, undo, stash, remote and debugging.
- Learn first: git clone, git status, git add, git commit, git push and git pull.
- Learn next: git checkout -b (or git switch -c), git merge and git stash.
- Handle with care: git reset --hard and git clean -fd cannot be undone.
Commands by Group
- Setup5
- Workflow6
- Branching6
- Undo6
- Stash5
- Remote6
- Shortcuts6
My Learning Progress
Top 6 Daily Commands
git statusCheck what changedgit add .Stage all changesgit commit -m "message"Save a snapshotgit pushSend commits to GitHubgit pullGet the latest changesgit checkout -b <name>Start a new branchGit Commands Cheat Sheet: 40 Essential Commands
Search above or filter by group. Click any command to copy it. Angle brackets such as <file> mean "replace with your own value." For the full reference, see the official Git documentation.
Repository & Setup
5| Command | What it does |
|---|---|
git init | Initialize a new repository |
git clone <url> | Clone (copy) a repository to your computer |
git status | Check the status of your files |
git config --global user.name "Name" | Set your global username |
git config --global user.email "email" | Set your global email |
Why it matters: Use the same name and email as your GitHub profile so your work is credited to you.
Basic Workflow
6| Command | What it does |
|---|---|
git add . | Stage all changes |
git add <file> | Stage one specific file |
git commit -m "message" | Commit your staged changes |
git commit -am "message" | Stage and commit tracked files in one step |
git push | Push your commits to the remote |
git pull | Pull the latest changes |
Why it matters: This is the loop you repeat all day on the job. Write commit messages a stranger could understand, such as "Fix login validation," not "update."
Branching
6| Command | What it does |
|---|---|
git branch | List all branches |
git branch <name> | Create a new branch |
git checkout <name> | Switch to a branch |
git checkout -b <name> | Create and switch to a new branch |
git merge <branch> | Merge a branch into your current one |
git branch -d <name> | Delete a branch |
Why it matters: Teams never work directly on the main branch. Fluency here is one of the clearest signs you have worked in a team before.
Undo & Restore
6| Command | What it does |
|---|---|
git restore <file> | Discard changes in a file |
git restore . | Discard all changes |
git reset <file> | Unstage a file |
git reset --hard | Reset everything (be careful) |
git revert <commit> | Undo a commit safely |
git clean -fd | Remove untracked files and folders |
Why it matters: Interviewers love asking "how would you undo this?" Check the Safe Undo Guide before you run reset --hard or clean -fd.
Stash
5| Command | What it does |
|---|---|
git stash | Stash (shelve) your current changes |
git stash list | View your stashes |
git stash apply | Apply the latest stash and keep it |
git stash pop | Apply the latest stash and remove it |
git stash drop | Delete a stash |
Why it matters: Handy when a teammate asks for a quick fix and you are halfway through something else.
Remote Repository (GitHub)
6| Command | What it does |
|---|---|
git remote -v | View remote URLs |
git remote add origin <url> | Add a remote repository |
git push -u origin <branch> | Push and set the upstream branch |
git fetch | Fetch the latest changes without merging |
git pull origin <branch> | Pull from a specific branch |
git push origin --delete <branch> | Delete a remote branch |
Why it matters: This is how your portfolio gets onto GitHub where recruiters and hiring managers can see it.
Useful Shortcuts
6| Command | What it does |
|---|---|
git log --oneline | View commit history (short) |
git log --graph | View commit history (graph) |
git diff | Show what has changed |
git show <commit> | Show details of a commit |
git blame <file> | See who changed each line |
git bisect | Find the commit that introduced a bug |
Why it matters: Debugging commands separate juniors from confident mid-level engineers. Use blame to understand context, not to point fingers.
Modern Git note: Newer versions of Git also offer git switch <branch> and git switch -c <branch> for changing branches. They do the same job as checkout and checkout -b with less confusion. Both styles are accepted, so use whichever your team uses.
How to Undo Git Changes Safely
Undo commands are where beginners get hurt. Check the risk level before you run anything that discards work.
| Situation | Command | Risk |
|---|---|---|
| I staged the wrong file | git reset <file> | Low |
| A bad commit is already pushed or shared | git revert <commit> | Low - history kept |
| I want to park my work for a moment | git stash | Low |
| I want one file back the way it was | git restore <file> | Medium - edits lost |
| I want to throw away all local changes | git reset --hard | High - cannot undo |
| I want to delete untracked files and folders | git clean -fd | High - cannot undo |
Git Workflow for Beginners: Your First-Week Steps
Whether it is a take-home test or your first ticket at a new job, the flow is nearly always the same. Want to go deeper? Read the free Pro Git book.
# 1. Get the project git clone <url> # 2. Make your own branch git checkout -b feature/login-fix # 3. Review what you changed git status git diff # 4. Save your work git add . git commit -m "Fix login validation" # 5. Share it git push -u origin feature/login-fix
Why Git and GitHub Matter for Your Job Search
Pick the path that matches where you are right now, then see the industries Yochana recruits for.
GitHub Portfolio Checklist for Job Seekers
Recruiters and hiring managers look at your GitHub profile before they call. Tick items off as you complete them. Your progress is saved in this browser. Need help? See GitHub Docs.
Git and GitHub FAQ for Job Seekers
Do I need a GitHub account to get a tech job?
It is not a legal requirement, but many technical hiring teams ask for a GitHub link or a code sample. A simple, tidy profile with a few finished projects helps you stand out, especially if you are early in your career or changing fields.
What is the difference between Git and GitHub?
Git is the version control tool that runs on your computer and tracks every change to your files. GitHub is an online service that hosts Git repositories so you can back up, share and collaborate on code. Other hosts such as GitLab and Bitbucket work the same way.
Should I use git checkout or git switch?
Both work. Newer versions of Git added git switch for changing branches and git restore for discarding changes, because checkout was doing too many jobs. In an interview, using either is fine as long as you can explain what it does.
I ran the wrong command. Can I recover?
Often yes. Committed work is very hard to lose completely, and git reflog can show recent states you can return to. Changes that were never committed and then discarded with reset --hard or clean -fd are usually gone, which is why you should commit or stash first.
How can I practice without breaking anything?
Create a throwaway folder, run git init, and experiment freely. Try creating branches, causing a merge conflict on purpose and undoing changes. Nothing on your computer or GitHub is at risk until you push.
Can Yochana help me find my next role?
Yes. Yochana works with U.S. clients across technology and many other industries, including healthcare, engineering, finance and manufacturing. Share your resume through the Yochana contact page and the team will talk with you about roles that fit your skills and goals.
Related Searches
Ready to Make Your Next Move?
Skills get you the interview. The right partner gets you in front of the right employers. Talk with Yochana about roles across North America.
Talk to a Recruiter Explore Industrieshello@yochana.com | +1 248-213-6465 | Farmington Hills, MI
Sources and notes: Command reference based on the official Git documentation (git-scm.com/docs) and GitHub Docs (docs.github.com). Original cheat sheet layout inspired by the community graphic from @coders.world. Company figures (17+ years, 100+ U.S. clients) are Yochana internal figures. This article is general career education and not a guarantee of employment.


