git+gitee代码上传
- 1、git应用工具
- 下载安装
- gitee应用
- 注册并创建仓库
- 点创建后进入到仓库
- git命令
- 关于.gitignore
- 只执行一次的命令
- 经常执行的命令
1、git应用工具
下载安装
https://git-scm.com/downloads
$ git --version
git version 2.39.0.windows.2
代码仓库:
- github
- gitee
- gitlab (开源的工具,一般公司自己搭建)
gitee应用
Gitee - 基于 Git 的代码托管和研发协作平台
注册并创建仓库
点创建后进入到仓库
远程仓库:
git命令
关于.gitignore
在项目文件夹中创建一个.gitignore文件,可以git更新版本时进行忽略
# 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/
# IDE
/.idea/
.idea/
# database migrations
*/migrations/*.py
!*/migrations/__init__.py
.DS_Store
只执行一次的命令
Git 全局设置:(在桌面右键选择“git bash here”,将上面两条命令执行一次)
git config --global user.name "zp365"
git config --global user.email "16484964@qq.com"
创建 git 仓库:
mkdir my-django-site
cd my-django-site
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/zp365/my-django-site.git
git push -u origin "master"
重点三条
# 进行到项目目录
cd my-django-site
# 执行后会初始化文件夹
git init
git remote add origin https://gitee.com/zp365/my-django-site.git
windows系统 :一定进入项目目录中,右键“git bash here”,执行"git init"
执行“git remote add origin https://gitee.com/zp365/my-django-site.git”,以后执行命令就可以用origin代替仓库地址,以简化输入
经常执行的命令
git add .
git commit -m "本次提交内容的提示内容"
git push -u origin "master"