GIT Tips

  • list untracked files
git ls-files --others --exclude-standard
  • get the remote URL
git config --get remote.origin.url
  • change https to ssh
cd [REPO_DIR]
git remote set-url origin git@github.com:[ACCOUNT]/[REPO].git
  • revert uncommitted changes
git reset --hard HEAD
git checkout HEAD -- watch-list.txt
  • get the count of commits in git
git rev-list --count [revision]

或者获取全部

git rev-list --all --count
  • configure the .gitignore

下载.gitignore