Git and GitHub for beginners: the commands you need
Written by LitCareer · 12 Oct 2026 · 2 min read
Track your code, work with others and build a public portfolio, with the basic Git workflow explained.
Git versus GitHub
- Git is a version control tool on your computer. It records snapshots of your project so you can see what changed and go back if needed.
- GitHub is a website that hosts Git repositories online, so you can back up your work, collaborate and show your projects to employers.
The basic workflow
git init– start tracking a project folder, orgit clone <url>to copy an existing repository.git status– see what has changed.git add <file>– choose changes to include in the next snapshot.git commit -m "Add login form validation"– save the snapshot with a clear message.git push– upload your commits to GitHub.git pull– get the latest changes from GitHub.
Branches
Branches let you work on a feature without disturbing the main code:
git checkout -b new-feature(orgit switch -c new-feature) to create one.- Commit your work there, push it, and open a pull request on GitHub to review and merge it into main.
Good habits
- Commit small, focused changes often.
- Write messages that say what and why: "Fix tax rounding on invoices".
- Never commit passwords, API keys or private data. Use a .gitignore file for secrets and large files.
- Pull before you start work to avoid conflicts.
Use GitHub as your portfolio
Pin your best projects, add a README with screenshots and setup steps, and keep your profile tidy. Recruiters for technical roles often look at GitHub profiles.
Your next steps
- Learn init, add, commit, push and pull
- Use branches and pull requests for new features
- Never commit passwords or API keys
- Pin your best projects with clear READMEs
General guidance for learning, not professional, legal or financial advice. Want help for your own situation? Book 1:1 career help.


