Git in folders
MagnumOpus recognizes a git repository by itself as soon as you open a folder inside it. There is nothing to set up: status marks appear in the list, the preview gets the Changes and History tabs and the status bar shows the branch.
Reading and writing
Reading (status, differences, history, blame) runs inside the application. Git does not have to be installed, nothing is written to .git, nothing is fetched from the network and no commands from the repository configuration run (hooks, fsmonitor, filter drivers). So a downloaded archive with a .git folder inside cannot run anything just because you opened it, and a git commit in your terminal never hits a lock left by the explorer.
Writing (stage, commit, push, branches...) happens only when you click, and runs the installed git in the background - hooks, Git Credential Manager and your configuration work exactly as in a terminal. One write operation per repository runs at a time. Settings > Git > Git program (writing) shows which git was found and lets you choose another git.exe.
When git is missing, a writing action offers Download MinGit (the official minimal Git for Windows, checked against the SHA-256 of the release, installed to %LOCALAPPDATA%\MagnumOpus\git) or Choose git.exe…. MinGit includes Git Credential Manager and ssh, so writing works right away.
Status in the file list
| Mark | Meaning |
|---|---|
M | modified (M+ = part of the changes is staged) |
A | added to the index |
U | new, untracked (a whole new folder is one item) |
D | deleted |
R | renamed |
! | conflict |
| dimmed | ignored by .gitignore |
A folder with changes inside gets a dot in the color of its most serious state. In Details a Git column is added automatically ("Modified · staged", "3 changes"); you can also add Folder and +/- (added and removed lines against HEAD, computed only for visible rows). The list sorts by the Git column with the most serious state first.
The filter understands git status - a folder matches when anything inside has that state:
[git = changed]
[git = untracked]
[git = conflict]
NOT [git = clean]
Values: changed, modified, untracked, staged, added, deleted, renamed, conflict, ignored, clean (see Filter fields).
The branch chip in the status bar shows the branch, commits to push and to pull and the number of changes. Its tooltip adds the upstream, the last fetch and the last commit; a click opens its menu with Changed files, Fetch / Pull / Push, Branch list..., stash and the operation in progress.
Last known status at once. When you open a folder in a repository, the last known status - branch, ahead and behind, counts and file marks - is shown right away, also after a restart. It is dimmed and the real status replaces it in the background; until then it is information only, and Push, Pull, staging or discarding wait for the verified status. You can delete the saved states in Settings > Storage.
When the status check takes longer (a large repository, a slow drive), the branch chip shows the elapsed time and its menu has Cancel status check. Check status or opening the folder starts it again.
Repositories in subfolders
In a folder outside a repository - a folder with all your projects, for example - subfolders that are repositories are recognized without entering them. The Git column is added and shows each one's branch, commits to push and pull and the number of changes ("master ↑6 · 1 change", "main · no changes"), with the change dot and name color as inside a repository.
Only visible rows are checked, the status is computed in the background one repository after another and is released when the folder is no longer shown. A repository you enter is watched fully. This works on local drives only. Settings > Git > Status and performance has Find repositories in subfolders and Status of repositories in subfolders as separate switches; without status the column just says "repository".
Changes and History in the preview
A file in a repository has the preview tabs Preview | Changes | History, a folder Contents | Changes | History. The chosen tab is remembered for the next files.
- Changes shows the difference against HEAD as Lines or Side by side, with the changed part of a line highlighted and arrows to the next and previous change. A file changed both in the index and outside it offers All / Staged / Unstaged. An image shows both versions as pictures, side by side or with a Swipe slider, decoded by the same decoders as the preview (RAW, PSD, HEIC...).
- Changes of a folder lists the changed files under it, as a list or a folder tree. Hovering a file shows Stage, Unstage and Discard changes; the right click adds Compare with HEAD and File history.
- History lists the commits that change the file or folder. The selected commit has a card with its subject, hash, author, date and tags, buttons Compare with..., Restore and More (Show version, Save version as..., Copy hash, Create tag…, Revert commit, Edit commits from here…, Reset branch here).
The text preview of a changed file marks added, modified and removed lines next to the line numbers. The person icon in the header turns on Who changed it (blame): author, date and message by blocks, with a color stripe by age; a click on a block opens the commit in History.
Comparing versions
- Ctrl+click on a second commit in History compares the two commits, from the older to the newer one.
- Compare with... on a commit offers HEAD, local and remote branches and tags (for a file also the working copy).
- A double click on a file of a commit opens its change in MagnumOpus Diff. Files over 8 MB are always compared there.
Committing
Ctrl+Shift+G opens Changed files: all changes of the repository in one flat list with the Folder, +/-, Git, Modified and Size columns. You can also get there from the branch chip menu or with Commit... in the Changes tab of a folder.
- Tick the checkbox in the Git column to stage a file (on a selected row it applies to the whole selection). The list is split into Conflicts, Staged, Changed and New.
- To stage only part of a file, open its Changes tab and use Stage in the hunk header.
- Write the message above the list (Enter = new line) and press Ctrl+Enter or Commit (N).
The Commit button menu has Amend the last commit, Add Signed-off-by, Recent messages and Commit and push. The message draft is kept per repository. Hooks run as usual; when a commit fails, a dialog shows git's output.
Discard changes... puts files back to the index version. Ctrl+Z brings the changes back - a file that changed again in the meantime is not overwritten. The same goes for a discarded hunk.
Fetch, pull and push
The branch chip menu has Fetch, Pull and Push with commit counts. A branch without an upstream offers Publish branch; with diverged branches there is Force push (--force-with-lease, after a confirmation). Progress shows in the jobs panel, the cross cancels the operation.
When branches have diverged, Pull asks whether to merge or rebase and can remember the choice. Settings > Git > Pull with diverged branches: As configured in git, Always merge, Always rebase.
Branches and stash
Branch list... in the chip menu shows local branches (the current one, then recently used) and remote ones, with a search field. Clicking a branch shows its actions - clicking alone does not switch:
- Switch, New branch from here, Rename, Delete, Delete on the server.
- Merge into current, Rebase current onto this, Edit commits… (current branch).
- Expanding another branch shows the commits the current branch does not have; each can be cherry-picked.
When switching would overwrite uncommitted changes, it offers to carry them over (stash, switch, pop), keep them in the stash, or cancel. Stash changes… saves changes with a message (untracked files too), Stashed changes offers Apply, Pop and Drop. Ctrl+Z undoes creating, renaming and deleting a branch and dropping a stash.
Merging and conflicts
Merge into current works like git merge. On conflicts the Changes view opens with a Conflicts section and the branch chip shows the operation. A conflicted file has a bar in its Changes tab:
- Resolve in MagnumOpus Diff - a three-way merge; after saving without conflicts the file is marked resolved by itself.
- Ours / Theirs - take a whole side. During a rebase the buttons say Target / Your commit, because git swaps the sides.
- Mark as resolved - after resolving by hand.
Finish merge (the commit button, the chip menu or the switcher) commits once no conflicts are left; Abort merge returns to the state before it.
Automatic resolution
Right after a merge, rebase, cherry-pick, revert or pull, files that can be resolved completely and without risk are resolved and marked by themselves:
- both sides made the same change, or differ only in whitespace at line ends,
- git remembers how you resolved the same conflict before (rerere, for operations from MagnumOpus),
- mergiraf, shipped with the app, merges by syntax (two new functions or imports in the same place).
Nothing is committed. The Changes tab of such a file says how it was resolved and has Restore conflict; Ctrl+Z restores the conflicts of all of them. Settings > Git > Conflicts turns each part on or off and chooses the Merge tool - besides MagnumOpus Diff it offers VS Code, JetBrains IDEs, KDiff3, Meld, Beyond Compare, TortoiseGitMerge and merge.tool from your git configuration.
Cherry-pick, revert, rebase and Edit commits
- Revert commit in History asks Revert and commit / Only prepare changes (remembered in Settings > Git > Reverting a commit).
- Rebase current onto this asks first when it would rewrite commits already pushed.
- Edit commits (interactive rebase) lists the commits oldest first. Each can be Kept, Reworded, Squashed, Fixed up or Dropped, and moved with arrows (keys P / R / S / F / D, Ctrl+arrows). No terminal or text editor needed.
An operation in progress shows in the branch chip with Continue, Skip commit and Abort. Ctrl+Z moves the branch back before a merge, cherry-pick, revert or rebase while it still sits on the result.
Tags and Reset branch here
On a commit in History: Create tag… (with a description = annotated tag) and Reset branch here with three options - Keep changes staged for commit, Keep changes in files (default), Discard everything. Discard everything refuses to overwrite untracked files. The Tags section of the branch list adds New tag…, pushes tags and deletes them, also on the server. Ctrl+Z restores a new or deleted tag and moves the branch back after a reset (Discard everything also brings back the discarded changes).
File backups
What a git operation overwrites - Discard changes, Abort, Skip commit, Ours / Theirs, the conflict tool, Restore version, Reset with Discard everything - is backed up before the operation and stays in the repository for 30 days, even when the app crashes or restarts (the ref refs/mo/backup/...; git gc keeps it, push does not send it). Ctrl+Z brings it back as long as the window remembers the operation. Otherwise the branch chip menu has File backups: each backup lists its files, Save next to the files writes them as name (backup <date>).ext without overwriting anything, Delete backup removes it. The command palette has the list too (Git: repository file backups) - also when the branch chip is hidden. After a crash a notice says which repository has backups left.
A lock left by an interrupted git
When git finds its own lock (index.lock after a cancelled operation, for example), the error message offers Remove lock. It deletes only that .lock file in .git, and only when it is not fresh - a lock held by a running git in a terminal or an IDE stays.
Repository history
Ctrl+Shift+H (also the chip menu, the Git submenu of a folder or view.git-log) shows the whole history in the main list with a branch graph, labels, author, date and hash. Toggle All branches / Current only; the quick filter searches message, author, hash and branch names. Arrows, PageUp / PageDown and Home / End move between commits, Ctrl+C copies the hash, Back closes the view.
Worktrees
Ctrl+Shift+K (also Worktrees in the branch chip menu or view.git-worktrees) shows the worktrees of the repository in the main list: folder, branch or detached HEAD, number of changes, locked, folder missing. The buttons act on the selected row: Open (Enter, double click), New worktree… (branch name - an existing branch is checked out, a new one is created from HEAD of the worktree you are in; the folder is suggested next to the repository as <repository>-<branch>), Remove… (Delete), Lock / Unlock, Move… (only to a folder that does not exist yet) and Prune for worktrees whose folder is gone. Removing a worktree with changes or untracked files saves them to File backups first (Save next to the files puts them back into the worktree folder); staged versions that differ from the files are backed up too; links to folders inside the worktree are unlinked first so their target stays. Edits of assume-unchanged / skip-worktree files are backed up too. Removing refuses a nested repository anywhere inside (its history would be deleted), a submodule (also nested) with unpushed commits, a stash or uncommitted changes, an operation in progress (rebase, merge) and commits that only this worktree has (detached HEAD outside branches - create a branch first). The worktree open in this or another tab can't be removed or moved from here; one worktree operation runs at a time. File backups made in a worktree move with it - after removal they are in File backups of the main repository and Save next to the files puts them into the former worktree folder. The branch list marks branches checked out in another worktree - Open its worktree instead of Switch; git does not allow switching to them or deleting them. In an added worktree the branch chip has its own icon and its tooltip names the main repository.
Clone and create a repository
The menu of a folder's empty space has Clone Git repository… (the address is taken from the clipboard when there is one) and, outside a repository, Create Git repository here, which offers a .gitignore for Rust, Node.js, .NET, Python, Java and Go projects. Both are also commands: git.clone, git.init.
More in the Git submenu
- Copy GitHub link (GitLab, Gitea / Codeberg / Forgejo, Bitbucket) - a link to the item on the tracked branch, taken from the configuration without network access.
- Deleted files as ghosts (Settings > Git, off by default) - deleted files stay crossed out in the list; Enter opens the HEAD version, Restore puts them back.
Settings > Git
Every part can be turned off: status letter, name color, badge on icon, stripe at row edge, folder status, dimming ignored items, the Git column, branch in the status bar, preview tabs and line marks. Network drives are off by default (Branch only or Full status), and large repositories have a limit for searching new files. With Use git off the application ignores git entirely: no repository is read, git.exe never runs and all git menus, commands and shortcuts are hidden.