SuperAPI AI Directory

git-pull

Coding & development

View repository

Updated 11-11 22:14

About this skill

git pull

Sync with the latest state of the remote repository (Pull) and tell me the changed parts.

Procedure

  1. Check the current location, branch, remote / upstream, and the valid configuration ofpull.rebase / branch.<name>.rebase / pull.ff . If the target is unclear, upstream is not set, or a merge / rebase / conflict resolution is in progress, stop without making changes.
  2. Record the HEAD before pull with git rev-parse HEAD , and withgit status --short、git diff、git diff --cached、git stash list --format=%H record the OIDs of local changes, staged state, untracked files, and existing stashes. Untracked files are not considered protected by autostash.
  3. Without changing the existing integration settings, run git pull --autostash and record the exit code and output immediately after. If the method is unset and history has diverged, confirm and stop; do not automatically retry with another method.
  4. Do not judge success by the exit code alone; checkgit status、git diff --name-only --diff-filter=U, and verify the diff after execution and the stash OIDs. Separately verify completion of the integration process, absence of unresolved conflicts, and restoration of the local changes from before execution, and also report changes in staged state. Do not judge restoration by exact match of diff strings or changed paths alone; verify whether the recorded edits are preserved/reflected in the files after integration. If a new stash remains, changes are missing, or restoration cannot be confirmed, treat it as incomplete.
  5. If there is a failure, conflict, or unconfirmed restoration, stop there. Report whether it stopped during integration or restoration, the in-progress state of merge / rebase, changes to HEAD, conflict paths, the OIDs of remaining stashes, and the next check. Do not re-apply or delete stashes, reset, abort, or re-pull without approval.
  6. After confirming both succeeded, obtain the HEAD after pull, and withgit log --oneline <before>..<after> と git diff --stat <before> <after> / git diff <before> <after> summarize this operation's commits and file diffs. During rebase, rewritten local commits are also included in the range, so do not call all of them remote-originated. If HEAD is the same, report that there were no integrated changes.