docs: update project documentation in README.
This commit is contained in:
parent
24a3ff28e1
commit
08317cae00
38
README.md
38
README.md
@ -40,6 +40,7 @@
|
||||
|
||||
### 1. 软件安装清单
|
||||
- **Code Editor**: 推荐 [Cursor](https://cursor.com) (自带 AI) 或 VS Code + Windsurf 插件, [TRAE CN](https://www.trae.cn)。
|
||||
- **Git**: 分布式版本控制系统 (必装)。[下载地址](https://git-scm.com/)。
|
||||
- **Python 3.12+**: 访问 [python.org](https://www.python.org/downloads/) 下载。
|
||||
- **uv**: 极速 Python 包管理器 (比 pip 快 10-100 倍)。
|
||||
- Mac/Linux: `curl -LsSf https://astral.sh/uv/install.sh | sh`
|
||||
@ -50,6 +51,7 @@
|
||||
```bash
|
||||
python --version # 应显示 Python 3.12.x 或更高
|
||||
uv --version # 应显示 uv 0.x.x
|
||||
git --version # 应显示 git version 2.x.x
|
||||
```
|
||||
|
||||
---
|
||||
@ -769,6 +771,42 @@ load_dotenv() # 加载 .env
|
||||
api_key = os.getenv("DEEPSEEK_API_KEY")
|
||||
```
|
||||
|
||||
|
||||
### 4. Git 简明操作手册 (Cheatsheet)
|
||||
|
||||
Git 是程序员的"后悔药",它能记录你代码的每一次修改。
|
||||
|
||||
#### 4.1 第一次安装后的配置 (仅需一次)
|
||||
告诉 Git 你是谁:
|
||||
```bash
|
||||
git config --global user.name "Your Name" # 用英文名
|
||||
git config --global user.email "your_email@example.com"
|
||||
```
|
||||
|
||||
#### 4.2 常用指令图解
|
||||
1. **`git init`**: 初始化仓库 (在项目根目录运行,"我要开始记录这个项目了")。
|
||||
2. **`git status`**: 查看状态 ("现在有哪些文件变了?")。
|
||||
3. **`git add .`**: 暂存所有修改 ("把这些变化放进暂存区,准备存档")。
|
||||
* *就像玩游戏时按了“保存”,但还没确认覆盖存档覆盖。*
|
||||
4. **`git commit -m "描述"`**: 提交存档 ("确认保存,并写个备注")。
|
||||
* *备注要清晰,例如 "Fix: 修复了登录按钮的Bug"*。
|
||||
5. **`git log`**: 查看历史 ("查看存档记录")。
|
||||
|
||||
#### 4.3 常用场景速查
|
||||
- **我想把代码存到服务器 (Gitea)**:
|
||||
```bash
|
||||
git remote add origin <仓库地址>
|
||||
git push -u origin main
|
||||
```
|
||||
- **我想下载别人的代码**:
|
||||
```bash
|
||||
git clone <仓库地址>
|
||||
```
|
||||
- **后悔了,想撤销刚才的 `git add`**:
|
||||
```bash
|
||||
git reset
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🌟 结语
|
||||
|
||||
Loading…
Reference in New Issue
Block a user