Changes
Changes
4 min read
Everything you changed in the repository and haven't committed yet appears in the changes panel, on the right, when the // WIP row is selected in the graph. That's where you check each file in the diff, choose what goes into the next commit (the stage), throw away what you no longer want, tell git to ignore files and exchange changes with colleagues in the form of a patch.
This section explains that work from start to finish, before the commit. The commit itself (summary, description, amend, signing) is in the Commits section.
git keeps your work in three places, and Versora shows each of them:
| Place | What it is | Where it appears in Versora |
|---|---|---|
| Working directory | The files as they are on disk right now. | The panel's Unstaged files section; diff in "unstaged" mode (or "new file", for untracked files). |
| Stage (index) | What will go into the next commit. | The Staged files section; diff in "staged" mode. |
| HEAD | The last commit of the current branch. | The commit right below the // WIP row in the graph. |
To stage is to copy a change from the working directory to the stage. To unstage is the opposite: take it out of the stage, without touching the file on disk. To discard is to return the file on disk to what is in the stage (or in HEAD), and that does erase work, which is why Versora keeps a copy first.
- You edit the files in your editor. The panel updates on its own (see "Automatic refresh" in The changes panel).
- You click each file to read the diff (Reading the diff).
- You stage what goes into the commit: the whole file, a hunk or just a few lines (Staging).
- Whatever is left and is no good, you discard (Discarding changes).
- Files that should never go into the repository (logs, builds,
.env) go into.gitignore(Ignoring files). - You write the message and commit in the commit box.
| Page | What you find |
|---|---|
| The changes panel | The panel's sections, the list as paths or as a tree, each file's menu, the // WIP row menu and the automatic refresh when something changes on disk. |
| Staging by file, hunk and line | Staging and unstaging a file, a folder, everything, a hunk or chosen lines, the S, U and Ctrl+Shift+S shortcuts and the "Stage all changes" warnings. |
| Reading the diff | Unified or split, whole file or only the hunks, context lines, Ignore whitespace, wrapping lines, Markdown preview, image diff and Pixel mode. |
| Discarding changes | Discarding a file, a hunk, lines or everything, deleting a file, and the backup copy that lets you undo with Ctrl+Z. |
| Ignoring files and .gitignore templates | Ignoring a file, an extension or a folder from the file menu, and adding ready-made templates to .gitignore. |
| Creating and applying patches | Saving a commit or a file's changes as a .patch, applying a patch file and pasting a copied patch with Ctrl+V. |
| Shortcut | What it does | Where it works |
|---|---|---|
| S | Stages the selected file. | Changes panel and diff. |
| U | Unstages the selected file. | Changes panel and diff. |
| Ctrl+Shift+S | Stages everything. | Open repository. |
| Ctrl+Shift+U | Unstages everything. | Open repository. |
| Ctrl+Shift+Enter | Stages everything and commits. | Open repository (in a text field, only in the commit message). |
| Ctrl+Shift+M | Goes to the commit message. | Open repository. |
| Esc | Closes the diff (or clears the selected lines). | In the diff. |
| Ctrl+V | With a patch copied, opens "Apply patch from clipboard". | Outside a text field. |
| F5 | Refreshes the repository. | Anywhere. |
| Ctrl+Z | Undoes the last operation (for example, a discard). | Open repository, outside text fields. |
The keys that aren't fixed can be changed in Preferences › Keyboard shortcuts (see Keyboard shortcuts).
| Operation | Does Ctrl+Z undo it? |
|---|---|
| Stage and unstage (file, folder, everything, hunk, lines) | No. Just do the reverse operation: nothing on disk changes. |
| Staging a conflicted file (marking it as resolved, including through Stage all changes) | Yes. The file goes back to the conflict. |
| Discarding a file, a hunk, lines or everything | Yes. The app keeps a copy first, even during a stopped merge or rebase. |
| Deleting a file | Yes. |
| Ignoring from the file menu | No. Edit the .gitignore (it appears in the changes). |
| .gitignore templates | Yes, when the .gitignore already existed. |
| Apply patch from clipboard | Yes, for the files that already existed before the patch. |
| Apply patch… (from a file) | Yes. The files the patch created are deleted. |
The details, and when undo refuses, are in Discarding changes and in Undo and redo.
- Commits: the commit box, Conventional Commits, amend.
- Stash: saving changes for later, including just one hunk or a few lines.
- "Don't commit" list: files that are left out of "Stage all changes".
- Conflicts: what to do with the files in the "Conflicted" section.
- Blame and File history.