git-push

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Commit and Push

Git 提交与推送

Sweep every change into one commit and push it, in a single run. The target is a clean tree:
git status
reporting nothing left to commit and nothing left to push.
一次运行中,将所有更改汇总为一个 commit 并推送。目标是 clean tree:
git status
显示没有待提交的内容,也没有待推送的内容。

Run Flow

执行流程

1. Survey

1. 检查

Run
git status
,
git diff HEAD
, and
git log --oneline -5
in one batch — the diff is what you describe, the log is the commit style you match.
If the tree is already clean, tell the user "There are no changes to commit" and stop.
一次性批量运行
git status
、
git diff HEAD
和
git log --oneline -5
—— diff 用于描述改动,log 用于匹配 commit message 的风格。
如果工作树已经是 clean tree,告知用户“没有需要提交的更改”,然后停止。

2. Write the message

2. 编写提交信息

$ARGUMENTS
is the message when the user supplied one — use it verbatim. Otherwise write your own: English, short, in the style the log shows.
当用户提供提交信息时,
$ARGUMENTS
就是该信息——请原样使用。否则自行编写:使用英文,保持简短,并遵循 log 中体现的风格。

3. Ship

3. 推送

Run these three as one action, straight through:
  • git add -A
    — every change goes in: staged edits, unstaged edits, and untracked files alike
  • git commit -m "message"
  • git push
    — the current branch, as it stands
Secrets stay out of the commit: if the survey turned up
.env
, keys, or credential files,
git reset
those paths after staging and name them to the user.
Done when:
git status
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 add -A
    —— 纳入所有更改:包括已暂存、 未暂存的编辑以及未跟踪的文件
  • git commit -m "message"
  • git push
    —— 按当前状态推送当前 branch
Secrets 不应进入 commit:如果检查发现
.env
、密钥或凭据文件,在暂存后对这些路径执行
git reset
,并向用户列出它们。
完成标准:
git status
显示 clean tree —— working tree 干净,branch 与其 remote 同步 —— 并且你已报告 commit subject 以及推送到的 branch。