자식은 실수로 파일을 업로드 .idea 삭제

질문 :
프로젝트를 제출하는 경우 파일을 어떻게 해결하는 (예 : .idea)를 실수로 업로드 된 파일을 추가하는 것을 잊지 .gitignore? (여기서, .idea 파일 폴더, 예를 들어)

프로젝트 파일을 아래로 당겨 1

git pull origin master

파일을 추가합니다 필터링 할

a. 如果你有.gitignore文件,但是没添加误上传的文件夹(如.idea)
新起一行添加  .idea/
b. 如果你没有.gitignore文件,在你的项目里创建一个.gitignore的文件
将下面的文本放入即可

일반 .gitignore 파일

# Initially taken from Github's Python gitignore file

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
__pycache__
# C extensions
*.so
.DS_Store
.idea/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

data/
model/

3. 단말기 프로그램 실행 명령

# 删除github上的误上传文件.idea 
git rm -rf --cached .idea    

.gitignore 파일을 제출 (4)

git add .gitignore

5. 업로드

git commit -m '忽略idea'
git push -u origin master

추천

출처www.cnblogs.com/trotl/p/11874108.html