dotfiles
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDotfiles
Dotfiles
Carry out the user's request on their dotfiles: the GitHub repository
seven7thirty3five5/dotfiles,
cloned at . With no request, ask what to change.
~/.local/share/chezmoiA run starts and ends in sync: is clean, local matches
, and passes, so the home folder
matches the repository.
git statusmainorigin/mainchezmoi verify --exclude=scripts在用户的 dotfiles 上执行请求:GitHub 仓库
seven7thirty3five5/dotfiles,
克隆位置为 。如果用户没有提出具体请求,先询问需要更改什么。
~/.local/share/chezmoi每次运行开始和结束时都应保持同步: 干净,本地 与
一致,并且 通过,从而确保 home folder
与仓库相匹配。
git statusmainorigin/mainchezmoi verify --exclude=scripts1. Orient
1. 了解现状
- Confirm this machine publishes the dotfiles, since only the repository's
owner can push: prints
chezmoi execute-template '{{ .publishDotfiles }}',truesucceeds, andgit push --dry-runshowsgh auth statusas the active account (gh watches the workflows).seven7thirty3five5 - Start in sync. With clean and
git statuspassing,chezmoi verify --exclude=scriptspulls and applies the latest commits; thenchezmoi updatemust matchmain.origin/main - Read : its Design section explains how the setup works and where each kind of change belongs. Then read the files your change touches. For each chezmoi feature you use, read its page in chezmoi's reference: https://www.chezmoi.io/reference/.
README.md
When a check fails or the machine is out of sync, stop before editing and show
the user what you found: uncommitted work, edits to deployed files and unpushed
commits are theirs to settle. Done when every check passes and you can name the
owner of each thing your change touches.
- 确认这台机器负责发布 dotfiles,因为只有仓库所有者才能推送:
输出
chezmoi execute-template '{{ .publishDotfiles }}',true成功,并且git push --dry-run显示当前活动账户为gh auth status(gh 会监控各个 workflow)。seven7thirty3five5 - 从同步状态开始。当 干净且
git status通过时,chezmoi verify --exclude=scripts会拉取并应用最新提交;随后chezmoi update必须与main保持一致。origin/main - 阅读 :其中的 Design 部分会说明整个配置的工作方式,以及不同类型的变更 应放在哪里。然后阅读此次变更涉及的文件。对于使用的每个 chezmoi 功能,阅读 chezmoi reference 中对应的页面: https://www.chezmoi.io/reference/。
README.md
如果某项检查失败或机器状态不同步,请在编辑前停止,并向用户展示发现的问题:未提交的
工作、对已部署文件的修改以及未推送的提交都应由用户自行处理。只有当所有检查均通过,
并且你能明确说明此次变更涉及的每项内容由谁负责时,才算完成。
2. Change
2. 变更
Edit the repository's files: deploys them, replacing edits made
in the home folder ( names a deployed file's source).
Make every change work on macOS and Linux, with and without sudo. Follow the
README's Design section and the gotchas below, and write like the file you are
editing: plain comments that explain each command, option and template
function, and why, for a reader new to the tool.
chezmoi applychezmoi source-path FILEDone when finds nothing in the README, comments or checks that your
change made untrue.
git grep编辑仓库中的文件: 会部署这些文件,并覆盖 home folder 中手动进行的
修改( 可用于确定已部署文件的源文件)。确保每项变更都能在
macOS 和 Linux 上工作,并同时兼容有 sudo 和无 sudo 的环境。遵循 README 的 Design
部分以及下面的注意事项,并按照正在编辑的文件的风格编写:使用简洁注释解释每个命令、
选项和模板函数及其原因,让初次接触该工具的读者也能理解。
chezmoi applychezmoi source-path FILE当 无法在 README、注释或检查项中找到因此次变更而不再准确的内容时,才算完成。
git grep3. Verify
3. 验证
- and
python3 scripts/check-lint.pypass.python3 scripts/check-shell.py - shows only the changes you intended, including the setup scripts it will run. Then run
chezmoi diff.chezmoi apply
- 和
python3 scripts/check-lint.py均通过。python3 scripts/check-shell.py - 仅显示预期中的变更,包括将要运行的设置脚本。然后运行
chezmoi diff。chezmoi apply
4. Ship
4. 交付
- Commit in the style of .
git log - passes; it checks the applied machine and needs a clean tree.
sh scripts/check-install.sh - Push, and watch each workflow on the pushed commit until it finishes
(); Bootstrap takes about ten minutes. When one fails, fix it and ship again.
gh run watch
Done when every workflow passes and the machine is in sync. Report what changed,
and anything the user must do by hand on other machines.
- 按照 中现有的风格提交。
git log - 通过;该脚本会检查已应用配置的机器,并且要求工作树 保持干净。
sh scripts/check-install.sh - 推送提交,并监控该提交上的每个 workflow,直到全部完成();Bootstrap 大约需要十分钟。如果某个 workflow 失败,请修复后再次交付。
gh run watch
当所有 workflow 均通过且机器保持同步时才算完成。报告具体变更,以及用户是否还需要在
其他机器上手动执行某些操作。
Gotchas
注意事项
- On this machine, chezmoi commits and pushes each source change it makes
(,
chezmoi add), before your checks run. Create and edit source files yourself, with chezmoi's names (chezmoi edit,dot_,private_,executable_)..tmpl - When chezmoi stops managing a file, it leaves the file in place on every machine.
- upgrades everything on the machine: run it when the user asks, and test a changed part of it on its own.
update
- 在这台机器上,chezmoi 会在执行检查之前,自动提交并推送它所做的每项源文件变更
(、
chezmoi add)。请自行创建和编辑源文件,并使用 chezmoi 的命名规则 (chezmoi edit、dot_、private_、executable_)。.tmpl - 当 chezmoi 停止管理某个文件时,该文件仍会保留在每台机器上。
- 会升级机器上的全部配置:仅在用户提出要求时运行,并单独测试其中发生变更的 部分。
update