Site Tools


git

Table of Contents

Git

Git is a version control system for tracking changes to code. Initialize a folder as a git repository to save snapshots of your work, branch to experiment safely, and synchronize with teammates via remotes.

Every change is recorded as a commit, a snapshot of your project at a point in time. You can view history, revert to old commits, and understand who changed what and why. Git is decentralized—each person gets a full copy of the repository's history, so you work offline and sync with others when ready.

$ git init                    # create a repository
$ git add .                   # stage changes
$ git commit -m "message"     # create a commit
$ git push origin main        # push to remote

On a multi-person project, branching lets each developer work in isolation without conflicts. Create a branch, make changes, and merge back when ready.

Concepts

  1. Repositories
  2. Commits
  3. Staging
  4. Branches
  5. Merging
  6. Rebasing
  7. Remotes
  8. Pushing and pulling
  9. Undoing changes
  10. History and viewing commits
  11. Tags
  12. Conflicts and conflict resolution
  13. Stashing
  14. Cherry-pick
  15. Hooks
  16. Workflows
git.md · Last modified: