본문 바로가기
공부 및 활동/git

project에 .gitignore 추가하기

by KChang 2021. 9. 21.

1) 먼저 gitignore.io를 생성한다. https://www.toptal.com/developers/gitignore

2) git을 이용한다.

3) 마지막 변경 사용 적용

 

gitignore.io

Create useful .gitignore files for your project

www.toptal.com

  • 운영체제, IDE, 프로그래밍 언어 검색하여 생성하면된다.
  • 나 같은 경우, python django 추가!😁
# Created by https://www.toptal.com/developers/gitignore/api/python,django
# Edit at https://www.toptal.com/developers/gitignore?templates=python,django

### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
db.sqlite3
db.sqlite3-journal
media

# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.
# <django-project-name>/staticfiles/

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

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
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/
cover/

# Translations
*.mo

# Django stuff:

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

### Python ###
# Byte-compiled / optimized / DLL files

# C extensions

# Distribution / packaging

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

# Installer logs

# Unit test / coverage reports

# Translations

# Django stuff:

# Flask stuff:

# Scrapy stuff:

# Sphinx documentation

# PyBuilder

# Jupyter Notebook

# IPython

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .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.

# PEP 582; used by e.g. github.com/David-OConnor/pyflow

# Celery stuff

# SageMath parsed files

# Environments

# Spyder project settings

# Rope project settings

# mkdocs documentation

# mypy

# Pyre type checker

# pytype static type analyzer

# Cython debug symbols

# End of https://www.toptal.com/developers/gitignore/api/python,django

 

 

1) 먼저 gitignore.io를 생성한다. https://www.toptal.com/developers/gitignore

2) git을 이용한다.

3) 마지막 변경 사용 적용

vim .gitignore : .gitignore 생성 후 편집기로 들어간다.

gitigonre
  • i 입력 (현재 커서 위치에서 입력모드로 넘어간다.)
복붙
  • 다음으로, 생성했던 .gitignore 관련 소스 (나같은 경우 # Created by 부터 시작하는 내용) 을 복붙한다.
  • :wq! 명령어를 입력한 후 엔터를 누른다. 

 

1) 먼저 gitignore.io를 생성한다. https://www.toptal.com/developers/gitignore

2) git을 이용한다.

3) 마지막 변경 사용 적용

git add .
git commit -m "add .gitignore"
git push

 

끝~~🤗

 

 

참고 자료

'공부 및 활동 > git' 카테고리의 다른 글

Git 작업 컨트롤 전략  (0) 2021.10.07
github에 소스 추가하기(git bash 이용)  (0) 2021.08.10
SourceTree 사용하는 방법  (0) 2021.08.09
2. Merge, 충돌 해결 (병합 이슈)  (0) 2021.07.21
1. git 병합, 충돌 해결  (0) 2021.07.21

댓글