前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >git: .gitignore文件 (忽略文件)

git: .gitignore文件 (忽略文件)

作者头像
JNingWei
发布2018-09-27 16:21:55
2.1K0
发布2018-09-27 16:21:55
举报

作用

用于告诉Git需要自动忽略哪些文件。

配置

在仓库新建 .gitignore 文件。

这里写图片描述
这里写图片描述

写入要忽略的文件名填进去,Git就会自动忽略这些文件。

这里写图片描述
这里写图片描述

Note: 切记目录名后面 一定要加 反斜杠 / ,不然会当成 单文件 处理。

python下的gitignore文件模板

gitignore/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# 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/
.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

# 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/

辅助

经典的 .gitignore文件 格式:github/gitignore

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年12月01日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 作用
  • 配置
  • python下的gitignore文件模板
  • 辅助
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档