安装gitbash工具

地址:https://git-scm.com/downloads

github代码托管&&gitbash本地工具

----------------------------

1. 生成公钥

首先检查本机公钥:

$ cd ~/.ssh

2.如果提示:No such file or directory 说明你是第一次使用git。如果不是第一次使用,请执行下面的操作,清理原有ssh**。

$ mkdir key_backup

$ cp id_rsa* key_backup

$ rm id_rsa*

3.生成新的**:

$ ssh-****** -t rsa -C “您的邮箱地址”

Generating public/private rsa key pair.

Enter file in which to save the key (/c/Users/qingfeng/.ssh/id_rsa):

4.点击回车

Created directory '/c/Users/qingfeng/.ssh'.

5.两次输入密码

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /c/Users/qingfeng/.ssh/id_rsa.

Your public key has been saved in /c/Users/qingfeng/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:q8pOF7DbSTDs7kdlOuFL78htmada+bbvGoDgdtZiwLg “‘[email protected]

The key's randomart image is:

+---[RSA 3072]----+

| |

| + |

| . O |

| + B.oo |

| E =.O=S |

| o B*+ + |

| +o+++o. |

| + oo==.o. |

| .=o=++++=o |

+----[SHA256]-----+

[email protected] MINGW64

github代码托管&&gitbash本地工具

将id_rsa.pub公钥拷贝到下面新建的公钥中,名字随意,保存即可。

github代码托管&&gitbash本地工具

创建新的仓库

github代码托管&&gitbash本地工具

拷贝仓库地址备用,如下:[email protected]:qingfengzhuimeng/work_test_repo.git

github代码托管&&gitbash本地工具

回到gitBash命令行

1.创建本地项目,在项目根目录执行git init命令

$ git init

2.将现有项目添加并提交上传【来源:日志】

$ git config --global user.email "[email protected]"

$ git config --global user.name "Your Name"

【如下命令,GitHub新建仓库时官方会有命令提示】

$ git add -A $ git commit -m '初始化git项目'

$ git remote add origin [email protected]:qingfengzhuimeng/work_test_repo.git $ git push --set-upstream origin master

拉取

$ git pull origin master:master

提交

$ git push -u origin master

--------------------------

参考:https://blog.csdn.net/qq_37512323/article/details/80693445

           https://blog.csdn.net/zfs1994/article/details/52682129

           https://blog.csdn.net/kuangdacaikuang/article/details/84632883

 

 

相关文章:

  • 2021-11-30
  • 2021-11-30
  • 2022-01-08
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-11-30
猜你喜欢
  • 2021-10-27
  • 2021-11-30
  • 2021-10-23
  • 2021-06-02
  • 2021-12-16
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案