Git bash 登录以及clone、代码提交

1.git 登录

通过gitbash 直接进入git 命令模式
git的账号密码登录
git config --global user.email "847987366@qq.com"
git config --global user.name "Johnyewen123"

2.生成公共秘钥以及私有秘钥

ssh-keygen -t rsa -C "847987366@qq.com"

3.进入.ssh文件夹,将id_rsa.pub打开并将其拷贝

4.登录github ->进入设置->SHS and GPG key ->新建对应的秘钥

5.在本地新建文件,进行提交测试

5.1 进入文件夹,进行git init

git init

5.2 在github 上新建对应的repository

5.3 复制对应的git 项目远程地址

git@github.com:Johnyewen123/testgit20200212a.git

5.4 git add

$ git add test.txt

5.5 增加提交信息

$ git commit   -m "123

5.6 将本地的文件push到远端

git push git@github.com:Johnyewen123/testgit20200212a.git

git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明。
git remote rm origin
然后重新 安装上述过程 add->commit->push

ok结果如下

提交日志如下

原文地址:https://www.cnblogs.com/codeAndlearn/p/12298301.html