Learning path

The full stack learning path, simplified.

The shortest route from zero to a working app. A front-end in HTML, CSS and JavaScript, an ASP.NET Core back-end and a PostgreSQL database, and the two connections that hold them together.

Topic

Git

Git is a free, open-source version control system. It tracks every change to your code on your own computer, lets you go back to any earlier version, and lets a team work on the same project without overwriting each other. This topic covers the commands you will use every day.

Key focus points

01

Install and set up

  • Download Git for Windows, macOS or Linux from git-scm.com, then check it works with git --version.
  • Tell Git who you are once. Every commit you make carries this name and email: git config --global user.name "Your Name" and git config --global user.email you@example.com.
02

Repositories

  • A repository is where Git keeps the full history of a project. You have a local one on your computer and usually a remote one on GitHub.
  • Start a new repository in the current folder with git init.
  • Copy an existing repository, with its whole history, with git clone <url>, for example git clone https://github.com/etrupja/git-without-the-complexity.
03

The three trees

  • Working directory: the files you edit. Git notices changes here but does not save them.
  • Staging area (the index): the changes you have lined up for the next commit. You put them here with git add.
  • HEAD: the history of commits. git commit moves what is staged into HEAD.
  • The remote (origin) is a fourth place: the copy on GitHub that git push updates.
04

Add and commit

  • git add <filename> stages one file. git add . stages everything in the current folder, including subfolders.
  • git add does not save anything permanently. It only chooses what the next commit will contain.
  • git commit -m "Your message" saves the staged changes to HEAD. Write the message as what the change does: "Add login page".
  • After a commit the change is in your local repository only. Nobody else can see it yet.
05

Push to the remote

  • git push origin main sends your commits to the main branch on the remote.
  • If you started with git init, connect the local repository to GitHub first: git remote add origin <url>.
  • The default branch is called main. Older repositories call it master.
06

Branches

  • A branch is a separate line of work copied from another branch, so you can build a feature without touching main.
  • git checkout -b feature_branch creates the branch and switches to it. git checkout main switches back.
  • Branches are local until you publish them: git push origin feature_branch.
  • When a branch is finished and merged, delete it with git branch -d feature_branch.
07

Update and merge

  • git fetch downloads what is new on the remote without changing your files. git pull downloads and merges it into your current branch.
  • git merge feature_branch, run while on main, brings the feature commits into main.
  • When both branches changed the same lines, Git stops and asks you to resolve the conflict by choosing which code to keep.
  • Check what will change before merging with git diff main feature_branch.
08

Beyond the command line

  • Everything above also works in a graphical tool. GitHub Desktop is a good place to start and shows the same three trees.
  • The commands here are the ones you use every day. There is more to Git, but you do not need it yet.

See it happen: add, commit, push

Run the commands in order and watch one change move through the three trees and out to the remote.

Working directory
where you edit files
index.htmlM modified
Staging area
the index
nothing staged
HEAD
your local repository
no commits yet
Remote
origin, on GitHub
nothing pushed yet
$
1/4

You edited a file. Git sees it as modified, but nothing is saved yet.

See it happen: branch and merge

Run the commands one by one. Watch where HEAD is and which line each commit lands on.

mainfeature_branchc1c2c3c4mHEAD
$
1/6

main has two commits. Everyone on the team works from here.

Practice

  1. Create a folder, run git init, add a file, and make your first commit.
  2. Create a repository on GitHub, connect it with git remote add origin, and push your commit.
  3. Create feature_branch, make two commits on it, switch back to main and merge it. Look at the result with git log --oneline --graph.

Resources

Want the full picture?

This path skips the advanced topics on purpose. When you are ready to go deeper, the dedicated paths pick up where this one stops.