Site Tools


git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git [May 14, 2026 at 11:38] – external edit 127.0.0.1git [August 22, 2026 at 15:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 # Git # Git
-**Git** is a tool for managing repositories. Repositories are like folders, except it's easier to track the changes that happen inside them. 
  
-Think of project you've been working on e.g. a game in written in C++.+**Git** is version control system for tracking changes to codeInitialize folder as a git repository to save snapshots of your work, branch to experiment safely, and synchronize with teammates via remotes.
  
-You've been working on your game for weeks and now you have quite bit of code. You're starting to be little afraid of making changes... what if you break the code? Are you confident you will you be able to fix it? What if it takes too much time to fix it? What if you never fix it? Everything you've been working on for weeks will have been lost forever!+Every change is recorded as a **commit**, a snapshot of your project at point in time. You can view history, revert to old commits, and understand who changed what and why. Git is decentralized—each person gets full copy of the repository's history, so you work offline and sync with others when ready.
  
-So, like any prudent developer, you make backupsYou copy the "Gamefolder to Desktop and continue working on it without fear. If something goes wrong you just restore the backup! This works fine for a while, but then you notice you suddenly have a lot of "backups" on your Desktop.+```bash 
 +$ git init                    # create a repository 
 +$ git add                   # stage changes 
 +$ git commit -m "message    # create a commit 
 +$ git push origin main        # push to remote 
 +```
  
-Even worsesome of these "backups" don't compile at allYetthese backups that don't compile contain some code you developed that you now need. So, now you have to resort to CTRL + C, CTRL + V from those broken backups, and patch your real code with it. But of course, not before you make another backup.+On a multi-person projectbranching lets each developer work in isolation without conflictsCreate a branchmake changes, and merge back when ready.
  
-![When you're not using git](git-folders.png)+## Concepts 
 + 
 + 1. [[git-repositories|Repositories]
 + 2. [[git-commits|Commits]] 
 + 3[[git-staging|Staging]] 
 + 4. [[git-branches|Branches]] 
 + 5. [[git-merging|Merging]] 
 + 6. [[git-rebasing|Rebasing]] 
 + 7. [[git-remotes|Remotes]] 
 + 8. [[git-pushing-and-pulling|Pushing and pulling]] 
 + 9. [[git-undoing|Undoing changes]] 
 + 10. [[git-history|History and viewing commits]] 
 + 11. [[git-tags|Tags]] 
 + 12. [[git-conflicts|Conflicts and conflict resolution]] 
 + 13. [[git-stashing|Stashing]] 
 + 14. [[git-cherry-pick|Cherry-pick]] 
 + 15. [[git-hooks|Hooks]] 
 + 16. [[git-workflows|Workflows]]
  
-Okay, this is way too many backups. Surely, there's gotta be a better way?  
-Yes! That is exactly the problem that Git solves. 
git.1778758708.md.gz · Last modified: by 127.0.0.1