• .gitignore模板


    其实每次在新建一个库的时候,github上都有勾选创建.gitignore的选项,可以自己选择语言,python,java等等,那我每次都勾选了。然后在做Django项目的时候,加了一个忽略.idea的文件夹。

    .gitignore

    # Byte-compiled / optimized / DLL files
    __pycache__/
    .idea
    *.py[cod]
    *$py.class
    
    # C extensions
    *.so
    
    # Distribution / packaging
    .Python
    build/
    develop-eggs/
    dist/
    downloads/
    eggs/
    .eggs/
    lib/
    lib64/
    parts/
    sdist/
    var/
    wheels/
    pip-wheel-metadata/
    share/python-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
    *.py,cover
    .hypothesis/
    .pytest_cache/
    
    # Translations
    *.mo
    *.pot
    
    # Django stuff:
    *.log
    local_settings.py
    db.sqlite3
    db.sqlite3-journal
    
    # 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
    
    # pipenv
    #   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
    #   However, in case of collaboration, if having platform-specific dependencies or dependencies
    #   having no cross-platform support, pipenv may install dependencies that don't work, or not
    #   install all needed dependencies.
    #Pipfile.lock
    
    # PEP 582; used by e.g. github.com/David-OConnor/pyflow
    __pypackages__/
    
    # Celery stuff
    celerybeat-schedule
    celerybeat.pid
    
    # 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/
    View Code

    一般呢,如果是忽略文件夹的话是会加上/的,不加好像也行,自己可以用git status看看。

    ./一般是当前路径为起点。

    ../一般是上层路径为起点

    *一般表任意。如*.txt表示任意以txt为后缀的文件

    主要辨别一点吧。

    ./dist/指的是忽略当前文件夹里面的dist文件夹

    dist/指的是忽略所有的dist文件夹,不止当前目录,还包括下层目录,下下层目录等等。

    若想上传gitlab,或其他git平台,可以直接复制这份.gitignore,若还有不完整的,可以自己按照格式添加。

  • 相关阅读:
    好用开源的C#快速开发平台
    Chrome 53 Beta一些有意思的改动
    前端面试问题总结
    前端构建的初步尝试
    [译] 如何运用新技术提升网页速度和性能
    切图崽的自我修养-[ES6] 迭代器Iterator浅析
    解决表单GET提交后台数据乱码问题
    设置port转发来訪问Virtualbox里linux中的站点
    linux杂谈(十三):代理server
    a little riak book
  • 原文地址:https://www.cnblogs.com/smart-zihan/p/12971502.html
Copyright © 2020-2023  润新知