Github 常见问题

Github 常见问题 设置 SSH 登录 Github 生成密钥 (Github 邮箱) ssh-keygen -t ed25519 -C "xxx@xxx.com" 复制 ~/.ssh/id_ed25519.pub 到Github 复制 ~/.ssh/id_ed25519 到需要登陆的机器 ~/.ssh/ 需要登陆的机器终端执行 eval "$(ssh-agent -s)" 同步主线冲突 This branch has conflicts that must be resolved 解决方法 从 main 分支新建一个 merge 备份 Discard 所有 main 分支的提交(还原成主线后同步到最新的主线) 解决冲突 # 拉取最新代码 git pull # 查看冲突 git status # 处理后提交 git add . && git commit -m merge && git push merge 没啥问题删除 merge 分支

April 17, 2024 · Kevin

SSH免密登录

SSH 免密登录 生成密钥 ssh-keygen -t rsa 将公钥 id_rsa.pub 复制到被登录服务器的~/.ssh/authorized_keys 文件 ssh-copy-id -p xxx root@xxx.xxx 密钥管理 新建 config touch ~/.ssh/config config 添加如下内容 Host a HostName a.liwei.host Port 1 User root IdentityFile /root/.ssh/id_rsa Host b HostName b.liwei.host Port 2 User root IdentityFile /root/.ssh/id_rsa 登录 登陆 a ssh a 登陆 b ssh b

May 5, 2023 · Kevin