git的使用与坑
git介绍
1 2 3 4 5 6 7 8
| 对程序的版本版本迭代有着非常重大的作用,配合```Github```的使用可以共享自己的项目并且邀请更多的人来一起维护项目进行项目迭代与维护。
#### git的安装部署
[gitx下载链接](https://git-scm.com/downloads)去下git,选择对应的安装安装,如果没有特殊需求基本一部到底就可以。最后在```cmd```输入git命令哦来测试安装。
```bash git -v
|
如果有版本信息则安装完成,如果没有请配置git的环境变量。
通常昰与github配合使用所以需要配置用户名与邮箱以及ssh密钥使用命令配置
1 2 3 4 5
| git config --global user.name "用户名" git config --global user.email "邮箱地址" git config --global --list
ssh-keygen -t rsa
|
git的使用教程
- 远程仓库
1 2 3 4 5 6 7 8
|
git init git add 文件 git commit -m "first commit" git branch -M main git remote add origin https://github.com/Tangriweili/Tang.git git push -u origin main
|
本地仓库与远程仓大体相同,不需要链接远程仓库地址。
1 2 3 4 5
| git init git add 文件 git commit -m "first commit" git branch -M main git push -u origin main
|
git常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| git add .
git config --global http.proxy 127.0.0.1:7890 git config --global https.proxy 127.0.0.1:7890
git config --global http.proxy socks5 127.0.0.1:7891 git config --global https.proxy socks5 127.0.0.1:7891
git config --global --get http.proxy git config --global --get https.proxy
git config --global --unset http.proxy git config --global --unset https.proxy
|
git中遇到的坑
相信对于经常使用git的朋友对于git真的是相爱相杀。尤其是提交代码到远程仓库上。GitHub仓库尤为明显。没办法对于github的使用,对网络的要求就非常高了,所以大家可以使用steam++对github网站进行加速。上传代码到仓库就需要自行去寻找代理软件了。VPN是一个不错的选择哦!