git 相关操作说明

1.先下载git相关软件

下载地址:

https://git-scm.com/download/win

下载其中一个安装
git 相关操作说明_第1张图片
2.打开gitee网站,注册账号
3.打开个人中心,选择ssh公钥,查看如何生成公钥
git 相关操作说明_第2张图片

4.生成公钥后,添加相应的公钥

具体仓库操作

1.第一次提交需要配置账号
git 相关操作说明_第3张图片
git 相关操作说明_第4张图片

或者直接通过终端修改

git config --global user.name 用户名
git config --global user.email 邮箱
git config --global user.password 密码

2.克隆项目到本地

git clone xxxx(地址)

如果是克隆项目指定分支到本地

git clone -b xxxx(分支名称)xxxxx(地址)

3.拉取指定分支(更新,记住第一次clone之后每次需要更新都是直接运行此命令)

git pull origin devlop(远程分支名称)

如果不拉取指定的分支直接

git pull

4.添加修改项

git add .

5.提交

git commit -m “xxx描述”

6.推送

git push

推送到指定分支

git push origin develop 

3.常见问题:

1.unable to rewind rpc post data - try increasing http.postBuffer

说明http.postBuffer太小,需要设置更大的值
运行以下命令

git config --global http.postBuffer 524288000

2.RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
运行以下命令

git config http.sslVerify "false"
git config https.sslVerify "false"

如果继续报错fatal: not in a git directory

需要先运行
git init
在运行

git config http.sslVerify "false"
git config https.sslVerify "false"

如果还不行,运行下面命令将https提交切换为http提交

git remote set-url origin http://gitee.com/xxxxxxx

3.如果一开始密码配置错误
可以打开windows凭据
控制面板->用户账户->windows凭据

git 相关操作说明_第5张图片

找到git凭据进行修改

git 相关操作说明_第6张图片

你可能感兴趣的:(gitee,git,git,gitee)