Engineering Tools for AI

Programmation

Termes Git/GitHub

Référence consultable pour comprendre repository, branch, commit, synchronisation, PR, conflits et actions Git sûres.

33 termes

Concepts de base

Repository

Repository

engineerdoge/math-ai-tools

Sens

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

Utilisation

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

Exemple

engineerdoge/math-ai-tools

Exemple de demande

Check the current repository status.

Concepts de base

Working tree

Working tree

git status

Sens

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

Utilisation

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

Exemple

git status

Exemple de demande

Show what changed in the working tree.

Concepts de base

Staging area

Staging area

git add src/components/SiteHeader.tsx

Sens

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

Utilisation

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

Note

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

Exemple

git add src/components/SiteHeader.tsx

Exemple de demande

Stage only the files for the Git terms page.

Concepts de base

Commit

Commit

git commit -m "Add Git terms reference"

Sens

A saved snapshot of selected changes in the repository history.

Utilisation

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

Exemple

git commit -m "Add Git terms reference"

Exemple de demande

Create a commit with a concise message.

Concepts de base

Diff

Diff

git diff

Sens

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

Utilisation

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

Exemple

git diff

Exemple de demande

Review the diff for unexpected changes.

Branches

Branch

Branch

qwen3.5

Sens

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

Utilisation

Branches let you develop a feature without changing main immediately.

Exemple

qwen3.5

Exemple de demande

Tell me which branch I am currently on.

Branches

main branch

main branch

main

Sens

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

Utilisation

Compare your working branch with main to see what changed.

Exemple

main

Exemple de demande

Compare this branch against main.

Branches

checkout

checkout

git switch qwen3.5

Sens

Changing the working tree to another branch or commit.

Utilisation

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

Note

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

Exemple

git switch qwen3.5

Exemple de demande

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

Branches

merge

merge

git merge main

Sens

Combining changes from one branch into another branch.

Utilisation

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

Note

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

Exemple

git merge main

Exemple de demande

Explain what would happen before merging main into this branch.

Branches

rebase

rebase

git rebase main

Sens

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

Utilisation

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

Note

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

Exemple

git rebase main

Exemple de demande

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

Synchronisation

clone

clone

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

Sens

Making a local copy of a remote repository.

Utilisation

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

Exemple

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

Exemple de demande

Clone this repository and show the available branches.

Synchronisation

remote

remote

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

Sens

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

Utilisation

Remote settings decide where pull and push communicate.

Exemple

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

Exemple de demande

Show the configured remotes.

Synchronisation

fetch

fetch

git fetch origin

Sens

Downloading remote branch information without changing your working files.

Utilisation

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

Exemple

git fetch origin

Exemple de demande

Fetch from origin, then compare this branch with main.

Synchronisation

pull

pull

git pull origin main

Sens

Fetching remote changes and applying them to the current branch.

Utilisation

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

Note

Pull can change your working branch and may cause conflicts.

Exemple

git pull origin main

Exemple de demande

Before pulling, check whether I have local uncommitted changes.

Synchronisation

push

push

git push origin qwen3.5

Sens

Uploading local commits to a remote repository.

Utilisation

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

Note

Push only uploads commits, not uncommitted working tree edits.

Exemple

git push origin qwen3.5

Exemple de demande

Push the current branch after confirming the build passes.

Synchronisation

origin

origin

git push origin qwen3.5

Sens

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

Utilisation

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

Exemple

git push origin qwen3.5

Exemple de demande

Check whether origin points to the expected GitHub repository.

Revue

Pull Request

Pull Request

Open a PR from qwen3.5 into main

Sens

A GitHub review page for discussing and merging branch changes.

Utilisation

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

Exemple

Open a PR from qwen3.5 into main

Exemple de demande

Summarize what should go into the PR description.

Revue

Review

Review

Review requested changes

Sens

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

Utilisation

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

Exemple

Review requested changes

Exemple de demande

Review this branch for bugs and missing tests.

Conflits

Merge conflict

Merge conflict

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

Sens

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

Utilisation

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

Note

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

Exemple

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

Exemple de demande

Explain the conflict and propose the safest resolution.

Conflits

Conflict marker

Conflict marker

<<<<<<< HEAD

Sens

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

Utilisation

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

Note

Conflict markers should not remain in committed code.

Exemple

<<<<<<< HEAD

Exemple de demande

Find any remaining conflict markers.

Conflits

Untracked file

Untracked file

?? src/lib/git-github.ts

Sens

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

Utilisation

New pages and components usually appear as untracked until staged.

Exemple

?? src/lib/git-github.ts

Exemple de demande

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

Conflits

Modified file

Modified file

M src/components/SiteHeader.tsx

Sens

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

Utilisation

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

Exemple

M src/components/SiteHeader.tsx

Exemple de demande

Show the modified files for this task.

Sécurité

stash

stash

git stash push -m "before branch switch"

Sens

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

Utilisation

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

Note

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

Exemple

git stash push -m "before branch switch"

Exemple de demande

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

Sécurité

reset

reset

git reset --soft HEAD~1

Sens

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

Utilisation

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

Note

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

Exemple

git reset --soft HEAD~1

Exemple de demande

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

Sécurité

revert

revert

git revert abc1234

Sens

Creating a new commit that undoes an earlier commit.

Utilisation

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

Exemple

git revert abc1234

Exemple de demande

Revert the problematic commit without rewriting shared history.

Sécurité

force push

force push

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

Sens

Overwriting a remote branch with your local branch history.

Utilisation

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

Note

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

Exemple

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

Exemple de demande

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

Sécurité

.gitignore

.gitignore

.next/

Sens

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

Utilisation

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

Exemple

.next/

Exemple de demande

Check whether build output is ignored properly.

Commandes

git status

git status

git status --short

Sens

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

Utilisation

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

Exemple

git status --short

Exemple de demande

Run git status and summarize only the important changes.

Commandes

git log

git log

git log --oneline -5

Sens

A command for viewing commit history.

Utilisation

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

Exemple

git log --oneline -5

Exemple de demande

Show the last five commits in a compact format.

Commandes

git add

git add

git add src/lib/git-github.ts

Sens

A command that stages changes for the next commit.

Utilisation

Use explicit paths when you want a focused commit.

Exemple

git add src/lib/git-github.ts

Exemple de demande

Stage only the files created for this page.

Commandes

git commit

git commit

git commit -m "Add Git terms reference"

Sens

A command that records staged changes into repository history.

Utilisation

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

Exemple

git commit -m "Add Git terms reference"

Exemple de demande

Commit the staged changes with a clear message.

Commandes

git pull

git pull

git pull --ff-only

Sens

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

Utilisation

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

Exemple

git pull --ff-only

Exemple de demande

Pull with ff-only if it is safe.

Commandes

git push

git push

git push origin HEAD

Sens

A command that uploads local commits to a remote branch.

Utilisation

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

Exemple

git push origin HEAD

Exemple de demande

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