Skip to content

Instantly share code, notes, and snippets.

@yuanliwei
Created December 11, 2015 17:31
Show Gist options
  • Save yuanliwei/81d2b62e30cf20545213 to your computer and use it in GitHub Desktop.
Save yuanliwei/81d2b62e30cf20545213 to your computer and use it in GitHub Desktop.
git忽略已经被提交的文件

git忽略已经被提交的文件

  • git rm --cached logs/xx.log
  • 然后更新 .gitignore 忽略掉目标文件
  • 最后 git commit -m "We really don't want Git to track this anymore!"

让git忽略文件改变

  • git update-index --assume-unchanged
  • git update-index --no-assume-unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment