Git Cheat Cheat

  • initialize a repository
    git init
  • Add a file to staging (file / current directory)
    git add <fname>
    git add .
  • Remove the file from staging
    git reset <fname>
  • Report the current state
    git status
  • Commit the staged files
    git commit -m "commit message"
  • Log of changes
    git log
  • Show Branch
    git show-branch
  • Remove a file
    git rm <fname>
  • Move a file
    git mv <oldfile> <newfile>
  • Clone a repository
    git clone