Skip to content

Commit 76dc09b

Browse files
committed
docs: 补充文档
1 parent 3333d3b commit 76dc09b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.en_US.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,27 @@ name = Git
8989
; Directories or files to be synchronized, concatenated from $HOME
9090
[configuration_files]
9191
.gitconfig_work
92+
93+
; XDG configuration file, concatenated from $XDG_CONFIG_HOME
94+
; see: https://specifications.freedesktop.org/basedir-spec/latest
95+
[xdg_configuration_files]
96+
git/config
9297
```
9398

99+
## Advanced
100+
101+
### Forced Restore
102+
103+
When using `backup-cli -r` to restore backups, the `--force` option does not bypass confirmation prompts even when set to force overwriting files. This is due to security and data integrity considerations; by default, backups are not overwritten without user consent.
104+
105+
- **Tip**: You can enforce a restore operation by setting the environment variable `BACKUP_FORCE_RESTORE = true`. However, it's important to note that this still requires using the `--force` argument in your command.
106+
107+
### Restoring Another's Backup
108+
109+
When attempting to restore files from backup directories into your `$HOME` directory, the issue might arise because their `$HOME` directories may differ from yours. Direct restoration would fail due to these differences.
110+
111+
- **Tip**: To successfully restore another person's backups, you can set the environment variable `BACKUP_UPSTREAM_HOME={theirs HOME directory}` in your command. This specifies where each file should be placed upon restoration, ensuring they are correctly located on your system.
112+
94113
## Who is Using
95114

96115
- [Wxh16144's Dotfiles](https://github.com/Wxh16144/dotfiles)

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,27 @@ name = Git
8989
; 要同步的目录或文件, 从 $HOME 开始拼接
9090
[configuration_files]
9191
.gitconfig_work
92+
93+
; XDG 配置文件, 从 $XDG_CONFIG_HOME 开始拼接;
94+
; see: https://specifications.freedesktop.org/basedir-spec/latest
95+
[xdg_configuration_files]
96+
git/config
9297
```
9398

99+
## 高级用法
100+
101+
### 强制还原
102+
103+
`backup-cli -r` 还原备份时使用 `--force` 无法强制覆盖文件(还是会进行二次确认)。因为数据是宝贵的,所以默认不会覆盖。
104+
105+
- **tips**: 你可以通过设置 `BACKUP_FORCE_RESTORE = true` 环境变量来强制还原。(还是需要加上 `--force` 参数)
106+
107+
### 还原他人的备份
108+
109+
还原备份目录中的文件到 `$HOME` 目录,但是他人的 `$HOME` 目录可能和你的不一样,所以不能直接还原。
110+
111+
- **tips**: 你可以通过设置 `BACKUP_UPSTREAM_HOME={别人的HOME目录}` 环境变量来还原他人的备份。
112+
94113
## 谁在使用
95114

96115
- [Wxh16144's Dotfiles](https://github.com/Wxh16144/dotfiles)

0 commit comments

Comments
 (0)