git-push
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Commit and Push
Git 提交与推送
Sweep every change into one commit and push it, in a single run. The target is a clean tree: reporting nothing left to commit and nothing left to push.
git status一次运行中,将所有更改汇总为一个 commit 并推送。目标是 clean tree: 显示没有待提交的内容,也没有待推送的内容。
git statusRun Flow
执行流程
1. Survey
1. 检查
Run , , and in one batch — the diff is what you describe, the log is the commit style you match.
git statusgit diff HEADgit log --oneline -5If the tree is already clean, tell the user "There are no changes to commit" and stop.
一次性批量运行 、 和 —— diff 用于描述改动,log 用于匹配 commit message 的风格。
git statusgit diff HEADgit log --oneline -5如果工作树已经是 clean tree,告知用户“没有需要提交的更改”,然后停止。
2. Write the message
2. 编写提交信息
$ARGUMENTS当用户提供提交信息时, 就是该信息——请原样使用。否则自行编写:使用英文,保持简短,并遵循 log 中体现的风格。
$ARGUMENTS3. Ship
3. 推送
Run these three as one action, straight through:
- — every change goes in: staged edits, unstaged edits, and untracked files alike
git add -A git commit -m "message"- — the current branch, as it stands
git push
Secrets stay out of the commit: if the survey turned up , keys, or credential files, those paths after staging and name them to the user.
.envgit resetDone when: shows a clean tree — working tree clean, branch in sync with its remote — and you have reported the commit subject and the branch it went to.
git status将以下三个命令作为一次连续操作执行:
- —— 纳入所有更改:包括已暂存、 未暂存的编辑以及未跟踪的文件
git add -A git commit -m "message"- —— 按当前状态推送当前 branch
git push
Secrets 不应进入 commit:如果检查发现 、密钥或凭据文件,在暂存后对这些路径执行 ,并向用户列出它们。
.envgit reset完成标准: 显示 clean tree —— working tree 干净,branch 与其 remote 同步 —— 并且你已报告 commit subject 以及推送到的 branch。
git status