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.