Git Cheat Sheet

  • Git is decentralized: every clone of a Git repository when in sync is an exact copy of the parent repository containing all of the history.
  • Setup a Git repository by creating a .git directory:
    $ git init [--bare -> without a working copy]
  • Stop the Git tracking and history by removing the .git directory.
  • If there is a file named .gitignore in the same directory as the .git directory, its contents (file paths) will be ignored by Git.
  • Workflow:
                 Git repository
                  /           \
                 /             \
                /               \
         changes in             staging
        the working   --------   area

    Continue reading “Git Cheat Sheet”