root@ubuntu:~/karmada/karmada_k8s# ssh-agent -s SSH_AUTH_SOCK=/tmp/ssh-z9EBng6tTBt9/agent.2111159; export SSH_AUTH_SOCK; SSH_AGENT_PID=2111160; export SSH_AGENT_PID; echo Agent pid 2111160; root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh Could not open a connection to your authentication agent. root@ubuntu:~/karmada/karmada_k8s# ssh-add -K ~/githubSsh/githubSsh Could not open a connection to your authentication agent. root@ubuntu:~/karmada/karmada_k8s# ssh-agent bash root@ubuntu:~/karmada/karmada_k8s# ssh-add -K ~/githubSsh/githubSsh unknown option -- K usage: ssh-add [options] [file ...] Options: -l List fingerprints of all identities. -E hash Specify hash algorithm used for fingerprints. -L List public key parameters of all identities. -k Load only keys and not certificates. -c Require confirmation to sign using identities -t life Set lifetime (in seconds) when adding identities. -d Delete identity. -D Delete all identities. -x Lock agent. -X Unlock agent. -s pkcs11 Add keys from PKCS#11 provider. -e pkcs11 Remove keys provided by PKCS#11 provider. -q Be quiet after a successful operation. root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh Enter passphrase for /root/githubSsh/githubSsh: Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh) root@ubuntu:~/karmada/karmada_k8s#
root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh Enter passphrase for /root/githubSsh/githubSsh: Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh) root@ubuntu:~/karmada/karmada_k8s# git push -u origin main Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts. Counting objects: 64, done. Delta compression using up to 64 threads. Compressing objects: 100% (63/63), done. Writing objects: 100% (64/64), 30.78 KiB | 2.56 MiB/s, done. Total 64 (delta 22), reused 0 (delta 0) remote: Resolving deltas: 100% (22/22), done. To github.com:magnate3/karmada_deploy.git * [new branch] main -> main Branch 'main' set up to track remote branch 'main' from 'origin'. root@ubuntu:~/karmada/karmada_k8s#
每次git push都有添加秘钥
root@ubuntu:~/karmada/karmada_k8s# git push -u origin main Warning: Permanently added the RSA host key for IP address '13.250.177.223' 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. root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh Could not open a connection to your authentication agent. root@ubuntu:~/karmada/karmada_k8s# ssh-agent bash root@ubuntu:~/karmada/karmada_k8s# ssh-add -K ~/githubSsh/githubSsh unknown option -- K usage: ssh-add [options] [file ...] Options: -l List fingerprints of all identities. -E hash Specify hash algorithm used for fingerprints. -L List public key parameters of all identities. -k Load only keys and not certificates. -c Require confirmation to sign using identities -t life Set lifetime (in seconds) when adding identities. -d Delete identity. -D Delete all identities. -x Lock agent. -X Unlock agent. -s pkcs11 Add keys from PKCS#11 provider. -e pkcs11 Remove keys provided by PKCS#11 provider. -q Be quiet after a successful operation. root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh Enter passphrase for /root/githubSsh/githubSsh: Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh) root@ubuntu:~/karmada/karmada_k8s# git push -u origin main Counting objects: 9, done. Delta compression using up to 64 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (9/9), 1.18 KiB | 1.18 MiB/s, done. Total 9 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), completed with 1 local object. To github.com:magnate3/karmada_deploy.git 40e36f4..48822d1 main -> main Branch 'main' set up to track remote branch 'main' from 'origin'. root@ubuntu:~/karmada/karmada_k8s#
git clone
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
上传图片
在编写Github的Readme时常常需要添加图片辅助说明。
首先,将需要的图片保存在本地文件夹。
其次,将本地的图片push到GitHub的远程仓库。
然后,在GitHub上打开图片,得到图片的url。
最后,在Readme中输入如下格式的代码:

创建一个分支
1,从已有的分支创建新的分支(如从master分支),创建一个dev分支 Git checkout -b dev 2,创建完可以查看一下,分支已经切换到dev git branch * dev master 3,提交该分支到远程仓库 git push origin dev 4,测试从远程获取dev git pull origin dev 或者: 如果用命令行,运行 git fetch,可以将远程分支信息获取到本地,再运行 git checkout -b local-branchname origin/remote_branchname
就可以将远程分支映射到本地命名为local-branchname 的一分支
root@ubuntu:~/tracingLK# git checkout -b dev1.0 Switched to a new branch 'dev1.0' root@ubuntu:~/tracingLK# ssh-agent bash root@ubuntu:~/tracingLK# git branch * dev1.0 main root@ubuntu:~/tracingLK# git push origin dev1.0 Total 0 (delta 0), reused 0 (delta 0) remote: remote: Create a pull request for 'dev1.0' on GitHub by visiting: remote: https://dev1.0 remote: To github.com:magnate3/tracingLK.git * [new branch] dev1.0 -> dev1.0 root@ubuntu:~/tracingLK# git pull origin dev1.0 From github.com:magnate3/tracingLK * branch dev1.0 -> FETCH_HEAD Already up to date. root@ubuntu:~/tracingLK# git branch * dev1.0 main root@ubuntu:~/tracingLK#
root@ubuntu:~/tracingLK/drivers# git push -u origin main Branch 'main' set up to track remote branch 'main' from 'origin'. Everything up-to-date root@ubuntu:~/tracingLK/drivers# git branch * dev1.0 main root@ubuntu:~/tracingLK/drivers# git push -u origin dev1.0 Counting objects: 16, done. Delta compression using up to 64 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (16/16), 29.52 KiB | 3.69 MiB/s, done. Total 16 (delta 0), reused 0 (delta 0) To github.com:magnate3/tracingLK.git 868d315..e25236b dev1.0 -> dev1.0 Branch 'dev1.0' set up to track remote branch 'dev1.0' from 'origin'.
插入代码片段
我们需要在代码的上一行和下一行用` “ 标记。“` 不是三个单引号,而是数字1左边,Tab键上面的键。要实现语法高亮那么只要在 “` 之后加上你的编程语言即可(忽略大小写)。