Git入门详解
- 本文承接上文 Git入门简介 并做了内容扩充。
 - 本文讲述Git工具的安装、配置及使用
 - 友情参考链接:https://gitee.com/all-about-git
 
1. Git安装
- 安装官网:https://git-scm.com/
 - 安装过程如下:



 - 双击
.exe默认安装即可 
2. Git配置
简易的命令行入门教程:
- Git 全局设置:
 
git config --global user.name "yourname"
git config --global user.email "your email"
 
- 设置SSH公钥:
参考 --> Git入门简介 
3. Git使用
- 创建 git 仓库:
 
mkdir circular_spot_detect
cd circular_spot_detect
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/start_2022/circular_spot_detect.git
git push -u origin "master"
 
- 已有仓库?
 
cd existing_git_repo
git remote add origin https://gitee.com/start_2022/circular_spot_detect.git
git push -u origin "master"
 
-  
若想维护自己的仓库或者更新代码
- 如果是在新的电脑上进行更新,则需要:
 
#第一次需要下载代码,下载链接即HTTPS链接 git clone xxxxx.git #然后进行代码或者文件的增加与删减 -------- 更新代码
 
#每次上传时需要先pull一下 git pull #然后添加更改 git add . #添加合并注释 git commit -m "更改了。。。" #上传: git push -  
上传代码到分支 branch:
 
#查看一下分支结构
git branch
#如果没有你自己的分支,新建分支
git checkout -b 分支名称
#已有分支,切换到当前分支
git checkout 分支名称
#将要上传的文件提交
git add .
#提交文件
git commit -m '提交的描述'
#push到远程仓库
git push origin 你的分支名称
                
![2023年中国人防服务需求现状及行业市场规模前景分析[图]](https://img-blog.csdnimg.cn/img_convert/5f9a07f83d7bf0dfabba7fb45fd93bc6.png)

















