# Command Glossary

### Setup

| Command                       | Usage                                 |
| ----------------------------- | ------------------------------------- |
| `git init`                    | Initialise repository                 |
| `git config <option> <value>` | e.g. `git config --global user.email` |

### Making Changes

| Command                     | Usage                                     |
| --------------------------- | ----------------------------------------- |
| `git add <file/directory>`  | Stage changes (use `.` to add everything) |
| `git commit -m "<message>"` | Commit staged changes                     |
| `git reset <file>`          | Unstage changes                           |
| `git restore <file>`        | Discard changes                           |
| `git revert <commit>`       | Undo changes                              |

### Viewing State

| Command             | Usage                                                                        |
| ------------------- | ---------------------------------------------------------------------------- |
| `git status`        | View tracked/untracked files                                                 |
| `git reflog`        | List all local changes                                                       |
| `git log`           | List repository history                                                      |
| `git show`          | Show current commit                                                          |
| `git diff <A> <B>`  | Show differences between A and B (A and B can either be commits or branches) |
| `git diff --staged` | Show changes made by staged files                                            |

### Working with Branches

| Command                    | Usage                                                       |
| -------------------------- | ----------------------------------------------------------- |
| `git branch`               | List branches                                               |
| `git checkout <branch>`    | Switch into a different branch                              |
| `git checkout -b <branch>` | Create and switch into a new branch                         |
| `git branch -d <branch>`   | Delete branch                                               |
| `git merge <branch>`       | Applies the changes from `<branch>` into the current branch |

### Working with Remotes

| Command           | Usage                                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------- |
| `git clone <url>` | Copy a remote repository                                                                    |
| `git fetch`       | Fetch changes from the remote                                                               |
| `git pull`        | Pull updates from remote to local (default iis via merge, use `--rebase` to specify rebase) |
| `git push`        | Push changes to remote                                                                      |

### Miscellaneous

| Command                | Usage                                      |
| ---------------------- | ------------------------------------------ |
| `git <command> -h`     | Show command usage                         |
| `git <command> --help` | Show detailed help page                    |
| `git blame <file>`     | Show who last modified each line in a file |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.nushackers.org/orbital/git/command-glossary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
