IT & 개발공부/깃허브(Github)
실용적인 깃허브 활용 방법 ( git clone 하고 push 까지 ) + git ignore
규딩코딩
2023. 8. 29. 22:33
- 이번 글에서는 실제로 개발공부를 하면서 정말 수십번도 해봤을테고 앞으로 몇 번이나 더 하게될 가장 많이 쓰게될 사용방법에 대하여 군더더기 없이 순서를 기록하려고 한다.
1. 깃허브 접속
2. 깃허브 REPO 생성
3. 깃허브 REPO 주소 복사
4. 원하는 폴더 경로에 Git Clone
5. git ignore 파일 수정
참고 : https://www.toptal.com/developers/gitignore
반응형
gitignore.io
Create useful .gitignore files for your project
www.toptal.com
- 위 링크에서 python(pycache 같은 것들) 과 venv(가상환경)을 Git에 올리지 않도록 다음과 같이 설정하였다.
- 특이점으로는 폴더무시가 보이는데 프로젝트를 진행하다보면 raw data들이 많이 쌓일 것이다. 그 과정에서 깃허브 Repo와 따로 관리하기도 좀 그렇고.. 할 때 해당 코드를 삽입해주면 "특정 폴더(이하 경로포함)"를 무시하고 git push 를 수행해준다.
=> 조건 : 현재 경로를 잘 파악하여 코드를 작성해야한다
# Created by https://www.toptal.com/developers/gitignore/api/python,venv
# Edit at https://www.toptal.com/developers/gitignore?templates=python,venv
# .gitignore 폴더 무시
data/
### Python ###
# 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/
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
*.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
.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
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__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/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml
# ruff
.ruff_cache/
# LSP config files
pyrightconfig.json
### venv ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json
# End of https://www.toptal.com/developers/gitignore/api/python,venv
프로젝트를 위한 깃허브 REPO를 만들고, 로컬에 Clone 하여 이후 관리하기 위한 기본 세팅을 마쳤다.
반응형