Git Cheat Sheet

Git Commits

  • A commit is a snapshot of all tracked files in your Git repository at a specific moment. Think of it as a checkpoint of your project’s state.
  • Instead of copying the entire directory, Git saves commits efficiently by storing only the changes (called a “delta”) from the previous version. This keeps commits lightweight.
  • Git tracks the history of commits, showing which came before others (visualized with arrows pointing to ancestor commits). This helps everyone on the team understand the project’s evolution.

                git commit
            

Git Branches

Branches are lightweight pointers to a specific commit in Git. They mark a commit and its parent commits, representing a line of development.


                git branch [yourbranchname]
git checkout [yourbranchname]
git commit
            

Configs

git config core.ignorecase false