🚧 Status: in progress. I will update this cheatsheet regularly with new commands.
Replace <username> with your GitHub username and <repo> with your project name.
1. Create a GitHub account
Tip
Already have a GitHub account? Skip this step.
- Sign up at https://github.com/signup.
- Verify your email address.
- Turn on two-factor authentication: Settings → Password and authentication → Enable two-factor authentication. Save the recovery codes.
- Optional: to hide your real email in commits, go to Settings → Emails and select Keep my email addresses private. Also select Block command line pushes that expose my email. There you will see your
noreplyaddress, such as00000000+mohattadev@users.noreply.github.com.
Warning
If you don’t hide your email, anyone can see your real email in your public commits and could use it for spam or phishing. Changing the setting later doesn’t change old commits.
How can people see it? Open a commit on GitHub and add .patch to the end of the address. The From: line shows the email.
General:
https://github.com/<username>/<repo>/commit/<commit-id>.patch
Result:
From: <name> <email>
Sample:
https://github.com/mohattadev/mohatta-dotnet-starter-kit/commit/1234567.patch
Result:
From 1234567 Mon Sep 17 00:00:00 2001
From: Mohatta <mohatta@example.com>
Date: Wed, 2 Dec 2026 09:30:00 +0700
Subject: [PATCH] docs: update README
Anyone who clones the repository can also see it with git log. Check your own commits this way.
2. Create a repository on GitHub
Tip
Already have a repository? Skip this step.
- Click + at the top right, then New repository.
- Enter a repository name and description.
- Choose Public, or Private if you are not ready to show it.
- Add a README, a
.gitignoretemplate and a license. - Click Create repository.
| File | What it is for | Without it |
|---|---|---|
README.md |
The front page of your repository. It says what the project is, its status and how to run it | Visitors see only a list of files |
.gitignore |
Lists files Git should not save, such as build output, downloaded packages and local settings | Unneeded or private files can be committed by mistake |
LICENSE |
Says how others may use your code. MIT allows use, change and sharing if they keep your copyright notice |
Others have no clear permission to reuse your code, even if the repository is public |
Learn about licenses at Choose a License, a well-known guide maintained by GitHub, or read about the MIT License.
Sample:
- Repository name:
mohatta-dotnet-starter-kit - Description:
.NET starter kit for web, desktop and mobile apps with AI coding assistants (in progress) .gitignoretemplate:VisualStudioif you use Visual Studio. If not, choose the template that fits your IDE or language.- License:
MIT - Topics (add them on the repo page after creating):
dotnet,starter-kit,angular,wpf,maui,microservices,aws
Add topics. Topics are tags that help people find your repository.
- Open your repository’s main page.
- Click the gear icon next to About on the right.
- In Topics, type a topic and press Enter. Repeat for each topic.
- Click Save changes. Your topics show under the description.
Use lowercase letters, numbers or hyphens, such as starter-kit.
3. Install Git
Tip
Already have Git? Run
git --versionto check, then skip the install.
Download Git from https://git-scm.com/downloads, install it once per computer, then check:
git --version
Sample result (your version number may be different):
git version 2.56.1.windows.1
4. Set name and email
Use the details from your GitHub account.
Note
Did you hide your email in step 1? Use your
noreplyaddress here. You can find it in Settings → Emails on GitHub.
General:
git config --global user.name "<your name>"
git config --global user.email "<your GitHub email>"
git config --global init.defaultBranch main
Sample:
git config --global user.name "Mohatta"
git config --global user.email "00000000+mohattadev@users.noreply.github.com"
git config --global init.defaultBranch main
What are the name and email for? Git saves them in every commit as the author, to show who made the change. They are not used to sign in.
- They don’t have to be the same as your GitHub account. Git accepts any name and email.
- Name: shown as the author in the commit history. Use the real name you use on GitHub, or a different one if you prefer.
- Email: GitHub uses it to link a commit to your account. Use an email added to your account (or your
noreplyaddress). Otherwise, the commit won’t link to your profile. - Public repos: others can see the email in your commits.
init.defaultBranch main names the first branch of new projects main.
5. Clone the repository
This copies your GitHub repository to your computer.
General:
git clone https://github.com/<username>/<repo>.git
cd <repo>
Sample:
git clone https://github.com/mohattadev/mohatta-dotnet-starter-kit.git
cd mohatta-dotnet-starter-kit
6. Commit
A commit saves a snapshot of your changes on your computer, with a short message that says what changed. It is not on GitHub yet.
Edit your files first, for example update README.md.
| Command | What it does |
|---|---|
git add . |
Adds all changes in the current folder (except ignored files) |
git add <file> |
Adds one file, such as git add README.md |
git add <file1> <file2> |
Adds several files, such as git add README.md LICENSE |
git status |
Shows which files will be committed |
git diff --staged |
Shows which lines will be committed |
git commit -m "<message>" |
Saves the commit with your message |
git add .
git status
git commit -m "docs: update README"
Commit messages
- Keep the first line short, about 50 characters.
- Start with a verb, such as
add,fixorupdate. - Say what changed. Avoid messages like “fix stuff”.
Following Conventional Commits is a best practice that makes commit messages easier to read. Write a type, a colon, then a short message.
| Type | Use for | Example |
|---|---|---|
feat |
A new feature | feat: add sign-in page |
fix |
A bug fix | fix: correct token expiry check |
docs |
Documentation only | docs: update README |
refactor |
Code change with no new behaviour | refactor: split user service |
test |
Tests | test: add sign-in tests |
chore |
Maintenance, such as packages or settings | chore: update packages |
7. Push
A push uploads your commits from your computer to GitHub. After that, others can see them if the repository is public.
Check for secrets first. Make sure your files have no passwords, API keys or tokens, then push:
git push