git

My Note

  • git diff staged files
bash
git diff --cached
  • Undo local changes to file
bash
git restore filename.txt
  • Get modified filenames
bash
git diff --name-only

# previous commit files
git diff HEAD^ HEAD --name-only
  • Short status
bash
git status --porcelain
  • Rank commiters for a file
bash
git shortlog -sne README.md