npx skills add https://github.com/colonelpanic8/dotfiles --skill logical-commits将混合的工作树转变为一系列清晰、原子化的提交。
运行:
git status --short
git diff --stat
git diff
如果已有暂存的更改,请检查两个视图:
git diff --staged
git diff
选择能最快证明仓库对当前项目有效的命令。优先使用项目标准命令(例如:just test、npm test、cargo test、go test ./...、nix flake check、有针对性的构建命令)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如果没有明确的命令:
在提交之前,写一个简短的规划:
如果变更相互交织,请按代码块拆分(git add -p)。如果代码块拆分不够,请使用 git add -e 或执行临时重构,以便每个提交保持连贯和有效。
首选的暂存流程:
git add -p <file>
git diff --staged
有用的修正命令:
git restore --staged -p <file> # 取消暂存特定的代码块
git reset -p <file> # 替代的取消暂存流程
切勿为了通过提交而暂存不相关的编辑。
使用当前的暂存/工作树状态运行选定的验证命令。
如果验证失败:
仅在验证通过后提交。
提交:
git commit -m "<type>: <logical change>"
然后确认:
git show --stat --oneline -1
确保剩余的未暂存更改对于后续提交仍然有意义。
完成提交栈后:
git log --oneline --decorate -n <count>
git status
报告:
每周安装次数
1
仓库
GitHub 星标数
210
首次出现
今天
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
Turn a mixed worktree into a clean sequence of atomic commits.
Run:
git status --short
git diff --stat
git diff
If there are staged changes already, inspect both views:
git diff --staged
git diff
Select the fastest command that proves the repo is valid for this project. Prefer project-standard commands (for example: just test, npm test, cargo test, go test ./..., nix flake check, targeted build commands).
If no clear command exists:
Before committing, write a short plan:
If changes are intertwined, split by hunk (git add -p). If hunk splitting is not enough, use git add -e or perform a temporary refactor so each commit remains coherent and valid.
Preferred staging flow:
git add -p <file>
git diff --staged
Useful corrections:
git restore --staged -p <file> # unstage specific hunks
git reset -p <file> # alternate unstage flow
Never stage unrelated edits just to make the commit pass.
Run the chosen validation command with the current staged/working tree state.
If validation fails:
Commit only after validation passes.
Commit:
git commit -m "<type>: <logical change>"
Then confirm:
git show --stat --oneline -1
Ensure remaining unstaged changes still make sense for later commits.
After finishing the stack:
git log --oneline --decorate -n <count>
git status
Report:
Weekly Installs
1
Repository
GitHub Stars
210
First Seen
Today
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装