Files
soul-yongping/Gitea同步说明.md

55 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 一场soul的创业实验-永平 → Gitea 同步说明
**Gitea 仓库**`fnvtk/soul-yongping`
**地址**<http://open.quwanzhi.com:3000/fnvtk/soul-yongping>
本仓库已配置:**每次 `git commit` 后自动推送到 Gitea**(见 `.git/hooks/post-commit`),有更新即同步。
---
## 一、首次使用(完成一次推送后,之后都会自动同步)
本仓库的 **gitea 远程已使用与卡若AI 相同的 Gitea Token**,只需在 Gitea 上建仓后推送即可。
### 1. 在 Gitea 上创建仓库(若还没有)
1. 打开 <http://open.quwanzhi.com:3000>,登录 **fnvtk**
2. 点击「新建仓库」。
3. **仓库名称**填:`soul-yongping`
4. 描述可填:`一场soul的创业实验-永平 网站与小程序`
5. 不要勾选「使用自述文件初始化」,创建空仓库。
### 2. 执行首次推送
```bash
cd "/Users/karuo/Documents/开发/3、自营项目/一场soul的创业实验-永平"
git push -u gitea main
```
外网需代理时先设置再推送:
```bash
export GITEA_HTTP_PROXY=http://127.0.0.1:7897
git push -u gitea main
```
首次推送成功后,**之后每次在本项目里 `git commit`,都会自动执行 `git push gitea main`**,无需再手动上传。
---
## 二、自动同步机制
- **触发条件**:在本项目执行 `git commit`(任意分支的提交都会触发 hook但推送的是 `main`)。
- **执行动作**`post-commit` 钩子会执行 `git push gitea main`
- **关闭自动推送**:删除或改名 `.git/hooks/post-commit` 即可。
---
## 三、手动推送(可选)
若需要单独推送到 Gitea不依赖 commit
```bash
git push gitea main
```