说明
本文记录本人平时使用 git 的记录和心得。
移除缓存区的不要的文件、且不删除本地文件
git status 查看缓冲区文件
(NLP) D:\Project\SeleniumProxy>git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: .gitignore
new file: .idea/.gitignore
new file: .idea/SeleniumProxy.iml
new file: .idea/deployment.xml
new file: .idea/encodings.xml
new file: .idea/inspectionProfiles/profiles_settings.xml
new file: .idea/misc.xml
new file: .idea/modules.xml
new file: .idea/vcs.xml
new file: __pycache__/ip.cpython-37.pyc
new file: __pycache__/tools.cpython-37.pyc
modified: iplib/ip.txt
new file: push.bat
git rm -r --cached 移除目录中的文件
(NLP) D:\Project\SeleniumProxy>git rm -r .idea --cached
rm '.idea/.gitignore'
rm '.idea/SeleniumProxy.iml'
rm '.idea/deployment.xml'
rm '.idea/encodings.xml'
rm '.idea/inspectionProfiles/profiles_settings.xml'
rm '.idea/misc.xml'
rm '.idea/modules.xml'
rm '.idea/vcs.xml'
git status 再次查看,发现没了
(NLP) D:\Project\SeleniumProxy>git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: .gitignore
new file: __pycache__/ip.cpython-37.pyc
new file: __pycache__/tools.cpython-37.pyc
modified: iplib/ip.txt
new file: push.bat