From 70121adaf6e45c29bbb4adad82e56bd933429221 Mon Sep 17 00:00:00 2001 From: mikemoi Date: Mon, 22 Jun 2026 23:36:38 +0200 Subject: [PATCH] Document Git clone and update workflow --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index e441d6f..18a5826 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,35 @@ crypto-atr-signal └── README.md ``` +## 获取与更新项目 + +推荐使用 SSH 克隆。Gitea 的 SSH 服务使用 `2222` 端口: + +```bash +git clone ssh://git@git.polarisx.net:2222/mikemoi/crypto-atr-signal.git +cd crypto-atr-signal +``` + +也可以使用 HTTPS: + +```bash +git clone https://git.polarisx.net/mikemoi/crypto-atr-signal.git +cd crypto-atr-signal +``` + +私有仓库通过 HTTPS 克隆时,请使用 Gitea 用户名和访问令牌,不要把账户密码写进命令或脚本。 + +服务器已经部署过项目时,使用以下命令获取最新版本: + +```bash +cd /www/wwwroot/crypto-atr-signal +git pull --ff-only origin main +.venv/bin/pip install -r requirements.txt +sudo systemctl restart crypto-atr-signal +``` + +`.env`、`data/app.db`、日志和虚拟环境已被 `.gitignore` 排除,执行 `git pull` 不会覆盖这些本地运行数据。更新前不要删除 `data` 目录或 `.env` 文件。 + ## 安装 ```bash