Home › Tools › Git
Tools

Git

Git tracks the history of your project: every change, who made it, and when. It also lets several people work on the same code without stepping on each other.

The basics

You stage changes, then commit them with a message. Each commit is a snapshot you can return to.

git add .
git commit -m "Add the login page"

Branches

A branch is a separate line of work. Make one, change things, then merge it back when it is ready.

git checkout -b new-feature
# ...make changes, commit...
git checkout main
git merge new-feature

Remotes

A remote is a copy of the repository somewhere else, usually a service like GitHub. You push your commits to it and pull other people's down.

git push origin main
git pull
Keep reading: JSON  ·  HTML & CSS  ·  SSH