Git is a history of your files. It is not GitHub, though GitHub is a common place to put that history. Your first day should be: install Git, tell it your name, make a folder, commit a file, and (optional) push it to a new GitHub repository. Branching theory can wait until you have something to lose.

What you need

  • The official Git for Windows installer
  • A free GitHub account only if you want a remote copy
  • A new empty folder for practice, not your whole Documents tree

1. Install Git for Windows

Download from https://git-scm.com/download/win. Run the installer. The defaults are fine for a first install, including “Git from the command line and also from 3rd-party software” and the default editor. Finish. Close old terminals. Open a new Terminal and run:

git --version

A version number means it worked. If not, the installer did not add PATH — reopen Terminal, or sign out and in.

2. Set your name and email

Git stamps every commit. Use a name you are willing to show, and the email you will use on GitHub if you push:

git config --global user.name "Alex Rivera"
git config --global user.email "you@example.com"

Check with git config --global --list. This is local config, not an account signup.

3. Create a repository and a first commit

Make a folder. In Terminal:

mkdir C:\Users\Public\git-practice
cd C:\Users\Public\git-practice
git init
echo hello > README.txt
git add README.txt
git status
git commit -m "Add a readme so this repo is not empty"

git status should say working tree clean after the commit. If Git complains that it does not know who you are, you skipped the config step. If echo looks odd in PowerShell, create README.txt in Notepad instead, then git add and git commit.

That folder is now a repository. The history lives in a hidden .git directory. Do not delete that folder if you care about the history.

4. Optional: push to GitHub

On github.com, sign in → New repository. Do not add a README if you already committed locally. Copy the commands GitHub shows for an existing repository, which look like:

git remote add origin https://github.com/YOURUSER/YOURREPO.git
git branch -M main
git push -u origin main

A browser window may ask you to sign in. After a successful push, refresh the GitHub page. Your README should be there. This is a backup and a way to work from another PC. It is not required to use Git on one machine.

5. The three commands you will actually use

git status
git add .
git commit -m "Describe what changed"

Status tells you what changed. Add stages those changes. Commit records them. Use a message that you would understand next month. “fix” is not a message. “Fix screenshot path in the printer guide” is.

Common first-day errors

  • Please tell me who you are — run the two config commands.
  • Rejected non-fast-forward on push — GitHub has a README you do not. Pull first or create the GitHub repo empty.
  • Do not run random git commands from a video on your real project folder until you can do this practice folder without notes.

If Python is not installed yet and you wanted a file to commit besides a readme, install that first: install Python on Windows.

Common questions

Is Git the same as GitHub?

No. Git is the history on your PC. GitHub is a website that can store a copy. You can use Git all day without GitHub.

What should a commit message say?

What you would need next month. “Fix screenshot path in the printer guide” is useful. “fix” is not.

Push was rejected.

The GitHub repo probably already has a README you do not. Create the GitHub repo empty, or pull first. Practice in a throwaway folder before you touch a real project.