### 初始化
git remote add origin git@github.com...(ssh)
### 重命名
git remote rename <old> <new>
### 使用ssh需要提供安全认证功能
### 直接push
$ git push kkk
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream kkk master
### 根据提示push,失败
$ git push --set-upstream kkk master
The authenticity of host 'github.com (::1)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
### 切换成https,在push,继续出错
$ git push --set-upstream kkk master
fatal: unable to access 'https://github.com/fireShad/fireshad.github.io.git/': SSL certificate problem: unable to get local issuer certificate
### 在切换成ssh,添加证书,文件在用户目录下.ssh文件中,拷贝id_rsa.pub,粘贴进github公钥
ssh-keygen -t rsa -Cgit@github.com:fireShad/fireshad.github.io.git
$ ssh-keygen -t rsa -Cgit@github.com:fireShad/fireshad.github.io.git
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/14247/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/14247/.ssh/id_rsa
Your public key has been saved in /c/Users/14247/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:iau0C30gv9JgVkkpvPFyRdTxVY0BoMIuJMAN2PBwn1k git@github.com:fireShad/fireshad.github.io.git
The key's randomart image is:
+---[RSA 3072]----+
|*=+ +E.....ooo+ |
|.*=oo=. .o . . .|
| o*=oo . . |
| oo=. o . |
| .+o o S |
| ++ o . |
| o.o+ o |
| .o.= |
| .=. |
+----[SHA256]-----+
### 若远程仓库发生改变,可以通过pull
git pull 连接名
### 在使用push 可以不加其他参数
git push 连接名
### 继续转换成https连接,还是不行
### 添加一条指令
git config --global http.sslVerify false