初始化演示仓:DKFile 介绍与 Git 零基础说明。

This commit is contained in:
DKFile 2026-07-21 18:50:58 +08:00
commit 0ae03e8d43
4 changed files with 247 additions and 0 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
# 本机临时文件
.DS_Store
*.swp
*~
# 编辑器
.idea/
.vscode/
# 环境与密钥(切勿提交)
.env
.env.*
*.pem
id_rsa*
credentials*

37
ABOUT-DKFILE.md Normal file
View File

@ -0,0 +1,37 @@
# 关于 DKFile 与 Source Git
## DKFile
- 官网https://dkfile.net/
- VIP 介绍https://dkfile.net/vip
DKFile 提供文件/页面相关能力;需要长期保存、多机同步、**随时回退**源码时,使用配套的 **Source Git**
## Source Git本站
- 地址https://git.dkfile.net/
- 演示仓https://git.dkfile.net/dkfile/demo
### 解决什么问题
1. **不用担心改坏**:每次提交都有版本记录,可回退。
2. **多台电脑同步**:家里、公司、笔记本用同一仓库 `pull` / `push`
3. **VIP 一键登录**:用 DKFile 账号登录本站(须为 VIP
### 和「随便拷贝文件夹」的区别
| 方式 | 风险 |
|------|------|
| 只拷贝文件夹 / U 盘 | 覆盖后难找回旧版;多机容易乱 |
| Source Git | 历史可查、可回退;多机以仓库为准 |
### 谁可以用
服务面向 **DKFile VIP**。成为 VIP 后,在本站点击「用 DKFile 登录」即可。
非 VIP 会引导至 VIP 介绍页。个别情况可由 **IDO老徐** 协助开通。
### 下一步
1. 阅读 [README.md](./README.md) 快速上手。
2. 按 [GIT.md](./GIT.md) 建自己的**私有**仓库练一遍完整流程。
3. 有问题联系 **IDO老徐**

129
GIT.md Normal file
View File

@ -0,0 +1,129 @@
# Git 基础使用说明(零基础)
面向 [DKFile Source Git](https://git.dkfile.net/) 用户。
目标:会**创建仓库**、**克隆**、**提交推送**、**换电脑同步**、**改坏了回退**。
---
## 0. 核心好处
先养成「改完一小段就提交」的习惯。一旦改坏了,用历史记录**回退**即可。其它电脑执行 `git pull` 即可同步。
口诀:**改完 push换电脑 pull改坏了回退。**
---
## 1. 登录本站并创建仓库
1. 打开 https://git.dkfile.net/ VIP 可用「用 DKFile 登录」。
2. 点击右上角「**+**」或「新建仓库」。
3. 填写**仓库名称**(例如 `my-project`)。
4. 可见性建议选**私有**。
5. 可勾选「使用 README 初始化」;空仓从本机首次推送也可以不勾。
6. 创建成功后复制仓库地址,形如:
```text
https://git.dkfile.net/你的用户名/仓库名.git
```
不会操作时联系 **IDO老徐**
---
## 2. 安装 Git本机
```bash
# macOS已装 Homebrew 时)
brew install git
# Windowshttps://git-scm.com/downloads 安装后打开「Git Bash」
git --version
```
---
## 3. 第一次配置身份(每台电脑执行一次)
```bash
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
```
---
## 4. 把仓库克隆到本机
```bash
git clone https://git.dkfile.net/你的用户名/仓库名.git
cd 仓库名
```
- 用户名 = 本站 Git 账号
- 密码建议用:**设置 → 应用 → Access Token**(不要用登录密码硬扛)
也可先克隆本演示仓练手:
```bash
git clone https://git.dkfile.net/dkfile/demo.git
cd demo
```
---
## 5. 日常:拉取 → 提交 → 推送
```bash
git pull
git add .
git status
git commit -m "说明本次改了什么"
git push
```
建议提交说明写清楚「改了什么」,方便以后回退时辨认。
---
## 6. 换任何一台电脑:拉取最新代码
```bash
# 新电脑第一次
git clone https://git.dkfile.net/你的用户名/仓库名.git
# 之后每次
cd 仓库名
git pull
```
---
## 7. 改坏了:回退到之前的版本
前提:之前已经 `git commit` 提交过。
```bash
# 1看历史
git log --oneline
# 2只恢复某一个文件推荐
git checkout 提交编号 -- 文件路径
git add .
git commit -m "回退某文件到指定版本"
git push
# 3整个项目回到某个历史版本慎用
git reset --hard 提交编号
# 需要服务器也回去时(覆盖远端,更慎用)
git push --force
```
也可在网页仓库的「提交」列表查看历史。拿不准时联系 **IDO老徐**
---
## 8. 建议
- 业务代码仓库保持**私有**。
- 本演示仓 `dkfile/demo` 仅作公开说明与练手,勿推密钥、密码、客户数据。
- 更多产品说明见 [ABOUT-DKFILE.md](./ABOUT-DKFILE.md) 与 [DKFile 官网](https://dkfile.net/)。

66
README.md Normal file
View File

@ -0,0 +1,66 @@
# DKFile Source Git · 演示仓库
本仓库是 [DKFile Source Git](https://git.dkfile.net/) 的**公开演示仓**,用来放:
1. **DKFile / Source Git 是干什么的**(一句话:改坏也能回退)
2. **零基础 Git 使用说明**(克隆 → 提交 → 推送 → 回退)
正式写业务代码时,请登录后**新建自己的私有仓库**,不要往本演示仓乱推敏感内容。
---
## DKFile 是什么
[DKFile](https://dkfile.net/) 是文件与页面托管相关的产品;**Source Git**`git.dkfile.net`)是配套的源码托管:
| 能力 | 说明 |
|------|------|
| 版本回退 | 每次 `commit` 都有记录,改坏了可以回到以前的版本 |
| 多设备同步 | 任意电脑 `git pull` 拉最新;改完 `git push` 上传 |
| VIP 登录 | VIP 可用 DKFile 账号在本站一键登录 |
- 官网https://dkfile.net/
- VIPhttps://dkfile.net/vip
- Source Githttps://git.dkfile.net/
开通与登录说明见站点首页;个别情况可联系 **IDO老徐**
---
## 5 分钟上手(口诀)
**改完要 push上传→ 换电脑要 pull下载→ 改坏了就回退。**
```bash
# 1本机安装 Git 后,配置一次身份
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
# 2克隆示例本演示仓
git clone https://git.dkfile.net/dkfile/demo.git
cd demo
# 3日常
git pull
# …改文件…
git add .
git status
git commit -m "说明本次改了什么"
git push
```
HTTPS 推送时,用户名用本站 Git 账号;密码建议用:**设置 → 应用 → 生成 Access Token**。
更完整的步骤见:[Git 基础使用说明](./GIT.md)。
---
## 本仓库文件
| 文件 | 说明 |
|------|------|
| [README.md](./README.md) | 本页:介绍 + 快速上手 |
| [GIT.md](./GIT.md) | 零基础教程:建仓、克隆、提交、多机同步、回退 |
| [ABOUT-DKFILE.md](./ABOUT-DKFILE.md) | DKFile / Source Git 简介与链接 |
欢迎 VIP 用户按教程建自己的私有仓练手。有问题联系 **IDO老徐**