新文件: "AI\346\212\200\346\234\257/.env"
新文件: "AI\346\212\200\346\234\257/docker-compose.yml" 修改: "GIT\346\212\200\346\234\257.md" 删除: README.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# GIT 功能应用
|
||||
|
||||
|
||||
公司 http://117.78.60.236:8000/users/sign_in zhanghonggang@csbr.cn w~7!
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ sudo apt install gitk git-cola 图形化工具
|
||||
全局设置
|
||||
git config --global user.email "zimyx@.com"
|
||||
git config --global user.name "Your Name"
|
||||
|
||||
git config --global credential.helper store 全局级别保存凭据,免密
|
||||
|
||||
```
|
||||
|
||||
@@ -25,9 +25,50 @@ git config --global user.name "Your Name"
|
||||
|
||||
|
||||
|
||||
### SSH 免密推送配置(你提供的步骤非常重要)
|
||||
|
||||
配置 SSH 密钥后,可以避免每次推送代码时输入密码:
|
||||
|
||||
#### 1. 生成 SSH 密钥对
|
||||
|
||||
```
|
||||
ssh-keygen -t rsa -C "your_email@example.com" 也可用用户名
|
||||
```
|
||||
|
||||
按提示完成三次回车即可生成密钥。查看公钥内容:
|
||||
|
||||
```
|
||||
cat ~/.ssh/id_rsa.pub
|
||||
```
|
||||
|
||||
#### 2. 在 Gitea 中添加 SSH 公钥
|
||||
|
||||
登录 Gitea Web 界面 → 点击右上角头像 → 设置 → SSH/GPG 密钥 → 添加密钥 → 粘贴公钥内容并保存。
|
||||
|
||||
#### 3. 修改远程仓库地址为 SSH 格式
|
||||
|
||||
```
|
||||
# 查看当前远程地址
|
||||
git remote -v
|
||||
|
||||
# 修改为 SSH 地址
|
||||
git remote set-url origin git@gitea.example.com:username/repo.git
|
||||
```
|
||||
|
||||
#### 4. 测试 SSH 连接
|
||||
|
||||
```
|
||||
在服务器上创建 zimy 用户并设置密码:
|
||||
sudo useradd -m -s /bin/bash zimy
|
||||
sudo passwd zimy 设置密码
|
||||
|
||||
|
||||
ssh -T zimy@zgene.cn
|
||||
```
|
||||
|
||||
首次连接会提示信任主机,输入 `yes` 确认。认证成功后会显示欢迎信息。
|
||||
|
||||
|
||||
公司 http://117.78.60.236:8000/users/sign_in zhanghonggang@csbr.cn w~7!
|
||||
|
||||
## 分支管理规范
|
||||
|
||||
|
||||
Reference in New Issue
Block a user