Engineering Tools for AI

编程

Git/GitHub 工作术语

了解 repository、branch、commit、同步、PR、冲突与安全操作的搜索型参考资料。

33 个项目

核心概念

Repository

Repository

engineerdoge/math-ai-tools

含义

A project folder tracked by Git, usually mirrored on GitHub.

用途

When you ask to inspect a project, commit work, or compare branches, the repository is the unit being handled.

示例

engineerdoge/math-ai-tools

请求示例

Check the current repository status.

核心概念

Working tree

Working tree

git status

含义

The files currently checked out on your machine, including edits that are not committed yet.

用途

Use it to separate committed history from the edits currently in progress.

示例

git status

请求示例

Show what changed in the working tree.

核心概念

Staging area

Staging area

git add src/components/SiteHeader.tsx

含义

A temporary selection of changes that will be included in the next commit.

用途

It lets you commit only the files or hunks that belong together.

注意

Staging does not save history by itself. The commit is what records it.

示例

git add src/components/SiteHeader.tsx

请求示例

Stage only the files for the Git terms page.

核心概念

Commit

Commit

git commit -m "Add Git terms reference"

含义

A saved snapshot of selected changes in the repository history.

用途

Commits make it possible to review, compare, deploy, or roll back changes later.

示例

git commit -m "Add Git terms reference"

请求示例

Create a commit with a concise message.

核心概念

Diff

Diff

git diff

含义

A line-by-line view of what changed between two file states.

用途

Diff is the quickest way to review exactly what an edit did before committing.

示例

git diff

请求示例

Review the diff for unexpected changes.

分支

Branch

Branch

qwen3.5

含义

A named line of work that can move separately from other lines of work.

用途

Branches let you develop a feature without changing main immediately.

示例

qwen3.5

请求示例

Tell me which branch I am currently on.

分支

main branch

main branch

main

含义

The default branch that usually represents the stable or production-ready version.

用途

Compare your working branch with main to see what changed.

示例

main

请求示例

Compare this branch against main.

分支

checkout

checkout

git switch qwen3.5

含义

Changing the working tree to another branch or commit.

用途

Use it when you need to inspect or continue work on another branch.

注意

Uncommitted edits can block switching branches if they would be overwritten.

示例

git switch qwen3.5

请求示例

Switch to the qwen3.5 branch after checking for uncommitted changes.

分支

merge

merge

git merge main

含义

Combining changes from one branch into another branch.

用途

Use merge to bring main updates into your feature branch or finish a feature into main.

注意

Merge can create conflicts when both branches edited the same lines differently.

示例

git merge main

请求示例

Explain what would happen before merging main into this branch.

分支

rebase

rebase

git rebase main

含义

Replaying commits from one branch on top of another base commit.

用途

It can make history look linear before merging a feature branch.

注意

Rebase rewrites commit history, so it should be used carefully on shared branches.

示例

git rebase main

请求示例

Do not rebase yet. First explain the risk on this branch.

同步

clone

clone

git clone https://github.com/user/project.git

含义

Making a local copy of a remote repository.

用途

It is usually the first step when starting work on an existing GitHub project.

示例

git clone https://github.com/user/project.git

请求示例

Clone this repository and show the available branches.

同步

remote

remote

origin git@github.com:user/project.git

含义

A named connection from the local repository to a repository hosted somewhere else.

用途

Remote settings decide where pull and push communicate.

示例

origin git@github.com:user/project.git

请求示例

Show the configured remotes.

同步

fetch

fetch

git fetch origin

含义

Downloading remote branch information without changing your working files.

用途

Use fetch before comparing your branch with the latest remote state.

示例

git fetch origin

请求示例

Fetch from origin, then compare this branch with main.

同步

pull

pull

git pull origin main

含义

Fetching remote changes and applying them to the current branch.

用途

Use it to update your local branch with work that was pushed elsewhere.

注意

Pull can change your working branch and may cause conflicts.

示例

git pull origin main

请求示例

Before pulling, check whether I have local uncommitted changes.

同步

push

push

git push origin qwen3.5

含义

Uploading local commits to a remote repository.

用途

Push makes your local commits available on GitHub or another remote.

注意

Push only uploads commits, not uncommitted working tree edits.

示例

git push origin qwen3.5

请求示例

Push the current branch after confirming the build passes.

同步

origin

origin

git push origin qwen3.5

含义

The conventional default name for the remote repository you cloned from.

用途

Most push, pull, and fetch examples use origin as the remote name.

示例

git push origin qwen3.5

请求示例

Check whether origin points to the expected GitHub repository.

审查

Pull Request

Pull Request

Open a PR from qwen3.5 into main

含义

A GitHub review page for discussing and merging branch changes.

用途

Use a PR to review changed files, run checks, discuss comments, and merge safely.

示例

Open a PR from qwen3.5 into main

请求示例

Summarize what should go into the PR description.

审查

Review

Review

Review requested changes

含义

Checking code changes for bugs, regressions, readability, and missing tests.

用途

Review helps catch issues before merging a branch into the shared codebase.

示例

Review requested changes

请求示例

Review this branch for bugs and missing tests.

冲突

Merge conflict

Merge conflict

CONFLICT (content): Merge conflict in src/app/page.tsx

含义

A situation where Git cannot automatically combine changes from different branches.

用途

You must choose the correct final content before the merge can continue.

注意

Do not blindly accept one side. Check the intended behavior first.

示例

CONFLICT (content): Merge conflict in src/app/page.tsx

请求示例

Explain the conflict and propose the safest resolution.

冲突

Conflict marker

Conflict marker

<<<<<<< HEAD

含义

Text markers Git inserts into a file to show conflicting versions.

用途

Markers show which part came from your current branch and which came from the incoming branch.

注意

Conflict markers should not remain in committed code.

示例

<<<<<<< HEAD

请求示例

Find any remaining conflict markers.

冲突

Untracked file

Untracked file

?? src/lib/git-github.ts

含义

A file that exists in the folder but has not been added to Git tracking yet.

用途

New pages and components usually appear as untracked until staged.

示例

?? src/lib/git-github.ts

请求示例

List untracked files and tell me which ones belong to this feature.

冲突

Modified file

Modified file

M src/components/SiteHeader.tsx

含义

A tracked file whose content differs from the last committed version.

用途

It helps you see which existing files were touched by the current work.

示例

M src/components/SiteHeader.tsx

请求示例

Show the modified files for this task.

安全操作

stash

stash

git stash push -m "before branch switch"

含义

Temporarily saving uncommitted changes so the working tree can become clean.

用途

Use stash before switching branches when you are not ready to commit.

注意

Stashed work can be forgotten. Always name it clearly and reapply it deliberately.

示例

git stash push -m "before branch switch"

请求示例

Stash my current edits with a clear message before switching branches.

安全操作

reset

reset

git reset --soft HEAD~1

含义

Moving branch or staging state back to another commit or state.

用途

Soft or mixed reset can adjust a local commit before it is shared.

注意

Hard reset can discard work. Ask for an explanation before using it.

示例

git reset --soft HEAD~1

请求示例

Explain the safest way to undo the last local commit without losing changes.

安全操作

revert

revert

git revert abc1234

含义

Creating a new commit that undoes an earlier commit.

用途

Revert is usually safer than rewriting history after commits have been pushed.

示例

git revert abc1234

请求示例

Revert the problematic commit without rewriting shared history.

安全操作

force push

force push

git push --force-with-lease origin qwen3.5

含义

Overwriting a remote branch with your local branch history.

用途

It is sometimes used after rewriting local history on a private feature branch.

注意

Force push can erase other people's remote commits. Prefer force-with-lease and confirm first.

示例

git push --force-with-lease origin qwen3.5

请求示例

Do not force push. Explain whether force-with-lease is necessary.

安全操作

.gitignore

.gitignore

.next/

含义

A file that tells Git which files or folders should not be tracked.

用途

Use it for build output, dependencies, local environment files, and temporary files.

示例

.next/

请求示例

Check whether build output is ignored properly.

命令

git status

git status

git status --short

含义

A command that shows branch, staged changes, modified files, and untracked files.

用途

Run it before editing, committing, pulling, or switching branches.

示例

git status --short

请求示例

Run git status and summarize only the important changes.

命令

git log

git log

git log --oneline -5

含义

A command for viewing commit history.

用途

Use it to find recent commits, compare work, or identify a commit to revert.

示例

git log --oneline -5

请求示例

Show the last five commits in a compact format.

命令

git add

git add

git add src/lib/git-github.ts

含义

A command that stages changes for the next commit.

用途

Use explicit paths when you want a focused commit.

示例

git add src/lib/git-github.ts

请求示例

Stage only the files created for this page.

命令

git commit

git commit

git commit -m "Add Git terms reference"

含义

A command that records staged changes into repository history.

用途

Use a message that says what changed and why it matters.

示例

git commit -m "Add Git terms reference"

请求示例

Commit the staged changes with a clear message.

命令

git pull

git pull

git pull --ff-only

含义

A command that updates the current branch from a remote branch.

用途

The --ff-only option avoids creating an unexpected merge commit.

示例

git pull --ff-only

请求示例

Pull with ff-only if it is safe.

命令

git push

git push

git push origin HEAD

含义

A command that uploads local commits to a remote branch.

用途

Use it after tests pass and commits are ready to share.

示例

git push origin HEAD

请求示例

Push this branch after confirming there are no lint or build failures.