Git
Aember works with git repositories directly: you can see the status of each file, stage and commit, manage branches, resolve conflicts, and sync with remotes without leaving the editor. When History is on, it records files before git changes them on disk, so you can bring back what git overwrites.
Git in the Navigator
When the project folder is a git repository, the navigator header has two lines. The first line shows the project name and a git button with the tooltip Git Options. The second line holds the branch controls and four git buttons. In a folder without a repository, the header has one line, and the button has the tooltip Project Options.
The second line has these controls, from left to right:
- The branch button (Manage Branches) opens the branch window. See Switch and Manage Branches.
- The branch menu (Current Branch) shows the current branch. Choose another local branch to switch to it.
- Pull Commits pulls from the remote. It is available in any repository.
- Stage Modified Files stages the selected files that have unstaged changes, and the changed files in selected folders. If nothing is selected, it stages every changed and untracked file.
- Commit Staged Files opens the commit dialog. It is available when files are staged.
- Push Commits pushes the current branch. It is available when you have commits that the remote does not have.
File status
A small colored icon in the lower-left corner of a file’s icon shows its git status:
| Icon color | Status |
|---|---|
| Orange | Modified |
| Green | Added |
| Red | Deleted |
| Blue | Renamed |
| Purple | Type changed |
| Pink | Conflicted |
Untracked files have names in a slanted style and no icon. Ignored files are dimmed. Hold the pointer over a file to see its staged and unstaged status in a tooltip.
Git also adds folders to the navigator. See The Git Folders in the Navigator.
Start or Clone a Repository
Start a repository
If the project folder is not a git repository, click the folder button at the left of the navigator header and choose Initialize Git Repository. The header changes to show the git controls. Branch controls appear after the first commit.
Clone a repository
- Choose File > New > Folder from Git Repo….
- In the Clone Git Repository dialog, enter the repository URL. Choose a persona from the Persona: menu, or choose None (use SSH).
- Click Clone, then choose a folder and click Clone Here.
The clone opens in a new window. If the repository has submodules, the Submodules Detected dialog lets you choose which ones to pull. Click Pull Selected, or Skip to pull none.
Repository Manager
In a repository, click the git button at the left of the navigator header and choose Open Repository Manager. The Repository Manager window has two sections:
- Repository Persona: choose the persona this repository uses for remote operations. The first item uses the default persona, and None (use SSH) uses your SSH setup. You define personas in Git settings. See Git Settings.
- Reset Repository: discards all uncommitted changes and untracked files, and resets the branch to match
origin/mainororigin/master. Aember asks you to confirm.
Warning: Reset Repository deletes untracked files and uncommitted changes.
The Git Folders in the Navigator
In a repository, the navigator shows extra folders in the tree. Each folder appears only when it has something to show.
| Folder | Contents |
|---|---|
| Staged Files | Files with changes staged for the next commit |
| Deleted Files | Files that git tracked and that were deleted from disk |
| Stashes | Your stashes, newest first |
| Unpushed Commits | Commits on the current branch that are not pushed yet, newest first |
The Unsaved folder, which lists files with unsaved changes, belongs to History. See History.
Actions in the folders
- In Staged Files, right-click a file and choose Unstage File. With several files selected, the item is Unstage Files. On a trackpad, you can also swipe left on a row with two fingers and click Unstage File. A swipe unstages only the file you swiped, even when other files are selected.
- In Deleted Files, right-click a file and choose Restore File to bring it back from the last commit. You can also swipe left on the file and click Restore File.
- In Stashes, double-click a stash, or choose Apply Stash… from its context menu, to apply it and remove it from the list. Delete Stash…, from the context menu or a swipe left, deletes a stash without applying it. Aember asks before either, and warns when files with unsaved changes could be overwritten.
- In Unpushed Commits, double-click a commit, or choose Show in Git History from its context menu, to select it in Git History. Choose Preview to see the commit’s changes as diff tabs. See Preview a Commit.
Stage Changes
Git commits what you stage. You can stage whole files or parts of files.
Stage whole files
- Git > Stage Current File (default ⌘⇧G) stages the file in the active editor.
- Git > Unstage Current File (default ⌥⌘G) unstages it.
- In the navigator, right-click a changed file. Choose Stage Changes, or Add to Repository for an untracked file. Choose Unstage Changes for a file with staged changes.
- In the navigator, right-click a folder and choose Stage Changes to stage every changed and untracked file in it, including files in its subfolders.
- Click Stage Modified Files in the navigator header to stage the selected files and folders, or all changed files when nothing is selected. Command-click or Shift-click to select several folders.
The same context menu has more items for changed files:
- Restore from Repository… replaces the file with its last committed version, after you confirm. It is not offered for new or untracked files.
- View Diff shows the file’s changes. See View a Diff.
- Stage Hunks… opens hunk staging. See Stage Parts of a File.
Right-click one of several selected files, and Stage Changes, Add to Repository and Restore from Repository… act on all of the selected files they apply to. Stage Changes also stages the changed files in selected folders.
Git stages the file on disk. If the file has unsaved changes, Aember asks whether to save first. See Unsaved Changes and History Checkpoints.
Stage Parts of a File
Hunk staging lets you stage some changes in a file and leave others unstaged.
- Open the file and choose Git > Stage Hunks… (default ⌃⌘G). You can also right-click the file in the navigator and choose Stage Hunks….
- A hunk staging tab opens with two panels. Unstaged Changes is on the left and Staged Changes is on the right.
- Click Stage on a hunk to stage it, or Unstage to unstage it. Click Stage All or Unstage All at the top of a panel to move every hunk.
A panel with no hunks shows that it has no changes. Hunks come from the file on disk, so Git > Stage Hunks…, and Stage Hunks… in the navigator, ask you to save first when the file has unsaved changes. The menu item is available when the active file has staged or unstaged changes.
Changed Lines in the Editor
In a file that git tracks, the editor gutter marks lines that differ from the last commit. The marks are next to the text, after the line numbers:
- A green bar marks added lines.
- A blue bar marks modified lines.
- A small red wedge marks where lines were deleted.
The marks compare the text in the editor, including unsaved edits, with the file in the last commit.
Click a mark to see the change. The dialog is Added Lines, Modified Lines, or Deleted Lines, and it shows the committed text for modified lines. It has three buttons:
- Revert Change puts the committed text back in the editor.
- Stage Change stages the hunk that holds the change. Nearby changes in the same hunk are staged too. Save the file first: Aember does not stage changes from a file with unsaved edits.
- Close closes the dialog.
To turn the marks off in one editor, right-click the gutter and choose Change Markers. See Choose What the Gutter Shows. To turn them off in every editor, clear Show changed lines in the editor gutter in Git settings. See Git Settings.
Commit Changes
- Stage the changes you want to commit.
- Choose Git > Commit… (default ⌘K), or click Commit Staged Files in the navigator header.
- In the Commit Changes dialog, type a message and click Commit.
Aember does not commit with an empty message. If a merge or revert has prepared a message, the dialog starts with it. If commits are signed in your git configuration, the dialog says which signature format it uses, and the status bar shows that the commit is being signed.
Your identity
If the repository has no name and email set, Aember uses the ones in your global git configuration. If there are none, the Git Identity Required dialog asks for your Name: and Email:. Click Continue to save them in the repository and go on to the commit.
Amend the last commit
Choose Git > Amend Last Commit…, or select Amend last commit in the commit dialog. The message changes to the last commit’s message. Clear the checkbox to get your own message back. Amending replaces the last commit with the staged changes and the new message.
You cannot amend while a merge, rebase, or revert is in progress. If the last commit is already pushed, Aember warns that you will need to force push, and you click Amend to go on.
Git commits the files on disk, so Aember asks about unsaved changes first. To commit work that you did not save, see Commit from History.
Stash Changes
A stash puts your uncommitted changes aside and returns the files to the last commit.
- Choose Git > Stash Changes….
- In the Stash Changes dialog, type a message to describe the changes, or leave it empty.
- Click Stash.
The stash includes staged and unstaged changes to tracked files. It does not include untracked files. If files have unsaved changes, Aember asks whether to save them first, so that the stash includes them.
Use a stash
Stashes appear in the Stashes folder in the navigator, newest first. Double-click a stash, or right-click it and choose Apply Stash…, to apply its changes and remove it from the list. To delete a stash without applying it, choose Delete Stash…, or swipe left on it with two fingers on a trackpad and click Delete Stash…. Aember asks before either.
When a branch switch fails because uncommitted changes would be overwritten, Aember offers Stash and Switch. This stashes your changes and then switches. See Switch and Manage Branches.
In Git History, you can also stash only the work done after a History moment. See Browse Git History.
Switch and Manage Branches
To switch quickly, choose a branch from the branch menu in the navigator header.
To manage branches, choose Git > Branch… (default ⌘⇧B), or click Manage Branches in the navigator header. The branch window lists local branches first, then remote branches marked “(remote)”. The current branch is in bold with a check mark. Type in the Filter branches… field to shorten the list.
- To switch, select a local branch and click the check mark button (Switch to Branch), press Return, or double-click the branch. You cannot switch to a remote branch from this window.
- To create a branch, click the + button (New Branch), type a name, and press Return. Press Escape to cancel. The branch starts at the current commit. Aember selects it but does not switch to it.
- To rename a local branch, right-click it, choose Rename Branch, type the new name, and press Return.
- To delete a local branch, right-click it and choose Delete Branch. You cannot delete the current branch. Aember asks you to confirm.
Click the cancel button or press Escape to close the window. Branch commands are available after the repository has its first commit.
When a switch is blocked
Before a switch, Aember warns about files with unsaved changes. If git refuses the switch because uncommitted changes would be overwritten, the Uncommitted Changes dialog appears. Click Stash and Switch to stash the changes and switch, or Cancel.
View a Diff
To see what changed in a file, right-click it in the navigator and choose View Diff. The item is available for a single file with changes.
The diff opens in its own tab. It is read-only. Added lines are green, deleted lines are red, and unchanged context lines use the normal text color. Line numbers are in the gutter.
The diff shows the file’s unstaged changes. For a new file that is only staged, it shows the staged changes. If there is nothing to show, the status bar says so.
Other places show diffs too:
- In Git History, the pane below the list shows the diff of the selected commit, moment, or commit boundary. See Browse Git History.
- While you resolve conflicts, the lower half of the edit panel shows a diff of the result. See Resolve Merge Conflicts.
- In the editor gutter, colored marks show lines changed since the last commit. See Changed Lines in the Editor.
- A commit you preview shows one diff tab for each file it changed. See Preview a Commit.
Preview a Commit
Previewing a commit shows what it changed and where in the project. To preview a commit, click its ring on the project strip, or right-click a commit in Unpushed Commits and choose Preview. An edit group’s Preview Commit previews the commit it was made from. See The Project Strip.
While a commit is previewed:
- Each file the commit changed opens in a diff tab of its own, in the commit’s order. The tab’s name is the file’s name. Hold the pointer over the tab to see the file’s path, or both paths for a file the commit renamed. The tab’s icon shows whether the commit added, deleted, changed or renamed the file. Diff tabs are read-only.
- Your own tabs and panes are set aside, unchanged. Unsaved changes stay too.
- In the navigator, the files the commit changed and the folders that hold them look as usual. Everything else is dimmed, and the folders that lead to the changed files are expanded. Files the commit deleted, and files deleted since, show in slanted type where they were. A file renamed since the commit shows at its new name. The special folders are not dimmed.
- Click a changed file in the navigator to show its diff tab.
- The commit’s ring on the project strip is filled.
When the commit changed more than 30 files, the first 30 open as tabs, and the banner says how many more there are. Click its Open All button to open them all. A merge commit shows its changes against its first parent. The first commit of a repository shows every file as added. For a binary file, the tab says that it changed and shows its size before and after.
The banner
A banner above the editors names the commit, with its short hash, author and date. It has these buttons. Hold the pointer over one to see its name and what it does.
- Create Edit Group from Commit makes a group of the commit’s files as they are now, and opens it. Renamed files are in it at their new names. Files deleted since the commit are left out, and the status bar says how many. The group is in the Commits folder inside Groups. When the commit has an edit group already, the button is Open Edit Group. See Use the Outline, Groups and Bookmarks.
- Park Here ends the preview and parks the window at the commit’s moment in History: for a commit made in Aember, the moment it was made, otherwise the last moment before its commit time. See Park the Window at a Moment.
- Done ends the preview.
End the preview
The preview ends when you click Done, press Escape, or click the commit’s ring again. Your own tabs, panes and active editor come back as they were. Saving the project during a preview saves your own layout, not the preview’s.
The preview also ends when you open a file in any other way than clicking a changed file in the navigator, close the last diff tab, load a group, park the window, or close the window. A file you open then opens among your own tabs.
A commit’s menu
Right-click a commit’s ring on the project strip for these items:
- Preview
- Create Edit Group from Commit, or Open Edit Group
- Park Here
- Restore Project to After This Commit… puts every project file back to how it was at the commit’s moment. It is one change you can undo, and Aember asks first. See Restore the Project to a Moment.
- Show in Git History
- Copy Commit Hash
Park Here and Restore Project to After This Commit… need History for the project and a license. See History and Your License.
Browse Git History
Choose Git > View History… (default ⌃⌘H) to open Git History in the edit panel. The commit list is on top and a diff pane is below it. If Git History is already open, Aember shows it again.
The list has the columns Hash, Message, Author, and Date. Select a commit to see its changed files and diff in the pane below.
To see only the commits that changed one file, type in the Filter by file… field in the toolbar. Aember suggests matching tracked files. Choose one to filter the list. Clear the field to see all commits.
Git History reloads when the repository changes, in Aember or outside it.
History’s moments
When History is on, Git History also shows History’s moments between the commits:
- Before each commit, a row such as “9 moments” holds the moments that led to it.
- After the newest commit, the Uncommitted row holds the work done since then.
Click one of these rows, or press Space or Return, to expand or collapse it. The Right and Left arrow keys expand and collapse too. Select a moment to see its diff.
Right-click a moment for these items:
- “Show History of” a file opens that file’s History pane at the moment. See History.
- Items to name the moment and to take changes out. See History.
- Stash Changes After This…, in the Uncommitted row only. Your uncommitted work goes into a git stash, and files return to how they were at that moment. Aember saves modified files first. History keeps every version, so you can undo this from History.
While you have unapplied commit edits, Git History shows only commits. See Edit Commits Before Rebasing.
Edit Commits Before Rebasing
In Git History, you can reword, squash, drop, and reorder commits, then apply all the edits at once. Nothing changes in git until you click Rebase in the toolbar.
Right-click a commit and choose an action:
- Reword lets you edit the message in the Message column.
- Squash combines the commit with the commit before it. If you select several commits and right-click one of them, the selected commits are combined into the commit before the first of them.
- Drop removes the commit.
To reorder commits, drag a commit row to a new place.
An edited commit has a menu that undoes its edit: Restore Original Message for a reworded commit, Unsquash for a squashed commit, and Undrop for a dropped commit. You can also undo and redo the edits. When you select a commit with squashed commits, the diff pane shows their combined diff.
When your edits are ready, click Rebase. The button is available only when there are edits. If you edited commits that are already pushed, the Editing Published Commits dialog warns that you will need to force push. Click Rebase Anyway to go on. If the rebase fails, for example because a commit conflicts in its new place, Aember puts the branch back where it was and the Rebase Failed dialog shows why. Your edits stay in Git History, so you can change them and try again.
Reverting a commit or resetting the branch discards unapplied edits. Aember asks first, with Discard Edits to go on.
Cherry-Pick, Revert, and Reset
Right-click a commit in Git History for these actions.
Cherry Pick
Cherry Pick… copies the commit to another local branch. In the Cherry Pick Commit dialog:
- Choose the branch from Target Branch:.
- Optionally, type a Commit Message (optional): to use instead of the commit’s message.
- Clear Commit immediately to apply the changes without committing them.
Click Cherry Pick. Aember switches to the target branch and applies the commit there. After a successful cherry-pick, you stay on the target branch. If it stops with conflicts, you also stay there, and the conflict editors open. See Resolve Merge Conflicts. If it fails for another reason, Aember switches back to the branch you were on.
Revert
Revert Commit… makes a new commit that undoes the commit. Click Revert to confirm. A merge commit is reverted against its first parent. If the revert has conflicts, the conflict editors open.
Reset
Reset Current Branch to Here… moves the current branch to the commit. Commits after it are no longer on the branch. In the Reset Current Branch dialog, choose a Mode:
- Soft keeps the changes staged.
- Mixed keeps the changes unstaged. This is the default.
- Hard discards all changes.
Click Reset. A hard reset asks again, with Reset and Discard.
Warning: A hard reset discards uncommitted changes to tracked files. History records the files first, so you can restore them from History. See Unsaved Changes and History Checkpoints.
Commit from History
In Git History, you can turn History’s moments into commits. You place commit boundaries between moments, then apply them. Nothing changes in git until you apply. This feature needs a license.
Commit all the work since the last commit
Choose Git > Commit from History… (default ⌥⌘K). Git History opens with a boundary after the last moment of the Uncommitted row and a drafted message. The diff pane shows the commit. Edit the message and press ⌘Return.
Place boundaries
Expand the Uncommitted row and move the pointer between two moments. A dashed line shows where a boundary can go. Click to place it. Each boundary closes a group of moments that becomes one commit, with the files as they were at that boundary.
A boundary row has:
- A message field (Commit message). Press Return to keep the message, or Escape to restore it. ⌘Return keeps it and makes the commits.
- A files button, such as “3 files” (Choose the files this commit takes). Use it to leave files out of the commit.
- A ✕ button (Remove Boundary).
Drag a boundary to move it. From the keyboard, select a moment: Return places a boundary below it or edits the one there, Delete removes it, and ⌥↑ and ⌥↓ move it. Click a boundary to see the diff of its commit. You can undo every change to boundaries. Aember keeps boundaries with the project until you apply them.
Apply
Click the Apply button in the toolbar, such as “Apply 2 Commits”. If a commit holds contents that were never saved to disk, Aember tells you that they were never built or tested. Click Make Commit or Make Commits to go on, or Save All and Commit to save modified files first. A Git setting can require saving first. See Git Settings.
Split a commit
In the moments before an unpushed commit, boundaries split that commit into several commits. The Apply button then reads “Split into 3 Commits”, for example.
Merge and Rebase
Merge a branch
- Choose Git > Merge Branch… (default ⌘⇧M).
- In the Merge Branch dialog, choose the branch to merge into the current branch, and click Merge.
- The Confirm Merge dialog shows how many commits will be merged. If there is more than one, you can select Squash commits into single commit. Click Merge.
For a squash merge, the Squash Merge Commit dialog shows a drafted message that lists the commits. Edit it and click Merge.
Rebase onto a branch
Choose Git > Rebase onto Branch… (default ⌘⇧R). In the Rebase Branch dialog, choose the branch to rebase the current branch onto, and click Rebase.
Both commands are available when the repository has another local branch.
When an operation stops
If the merge or rebase has conflicts, Aember opens the conflict editors. See Resolve Merge Conflicts.
If it stops without conflicts, a dialog explains that the operation is paused. A rebase can stop when a commit becomes empty because its changes are already on the target branch. The dialog has these buttons:
- Continue goes on with the operation.
- Skip Commit, for a rebase only, skips the current commit.
- Abort cancels the operation and returns to the previous state, after you confirm.
- Dismiss closes the dialog so that you can deal with the operation later.
Git > Continue Operation, Git > Skip Commit (rebase only), and Git > Abort Operation do the same things whenever a merge, rebase, revert, or cherry-pick is in progress, also after you dismiss the dialog or resolve conflicts.
Resolve Merge Conflicts
When a merge, pull, rebase, revert, or cherry-pick stops with conflicts, Aember saves your editor layout, closes the editors, and opens a tab for each conflicted file. This also happens when a git command run outside Aember leaves conflicts, and when you reopen the project. The top half of the edit panel is the conflict editor. The bottom half is a diff that shows what your choices add and remove.
The conflict editor
The toolbar says how many conflicts are unresolved, for example “branch main has 2 unresolved conflicts with feature”. If the file has more than one conflict, arrow buttons (Previous conflict and Next conflict) move between them.
The conflict markers are hidden. The current branch’s lines have a yellow background, and the incoming branch’s lines have a blue background.
Choose what to keep
Each conflict has two buttons in the gutter:
- The yellow button (Toggle current branch section) keeps the current branch’s lines.
- The blue button (Toggle incoming branch section) keeps the incoming lines.
Select one, both, or neither. With both, the current branch’s lines come first. When the incoming branch deletes the lines, its button is red (Toggle deletion (delete current branch content)), and selecting it strikes the lines through. The line numbers show the lines as they will be in the result. You can also edit the text directly.
The gutter buttons show whether or not line numbers are on.
Aember keeps your choices with the project, so they are still there if you close and reopen it.
If you save the file before you finish it, the conflicts you have not resolved stay in the file with their markers, and they are still open in the conflict editor.
Finish the file
Click the green check mark button at the right of the toolbar (Apply resolutions and stage the file). Aember replaces each conflict with the lines you chose, saves the file, and stages it.
A conflict with neither side selected is removed completely. Aember asks first (Remove Unresolved Conflicts?).
Aember then shows the next conflicted file. When no conflicted files are left, it restores your editor layout. To finish a merge, pull, or revert, choose Git > Commit…. The message prepared by git is already filled in.
Fetch, Pull, and Push
The status bar shows the progress and result of each remote operation.
- Git > Fetch downloads new commits and branches from the remote without changing your files. It uses the current branch’s upstream remote, or
origin. - Git > Fetch and Prune also removes remote-tracking branches that were deleted on the remote. A plain fetch prunes only if your git configuration says so.
- Git > Pull, or Pull Commits in the navigator header, fetches and then merges the upstream branch into the current branch. If the merge has conflicts, the conflict editors open. See Resolve Merge Conflicts.
- Git > Push, or Push Commits in the navigator header, pushes the current branch. If the branch has no upstream branch yet, Aember sets one on the branch’s remote, or on
origin. Push is available when you have commits that the remote does not have.
Force push
Git > Force Push… replaces the remote branch with your local branch. Commits on the remote branch that are not in your branch are lost. Click Force Push to confirm.
The force push uses a lease: if someone pushed to the branch since your last fetch, the push is refused, and the Remote Branch Has Changed dialog appears. Fetch, look at the new commits, and try again. Force push needs an upstream branch.
Credentials
For HTTPS remotes, Aember uses the repository’s persona. For SSH remotes, it uses your SSH setup. Set the persona in the Repository Manager. See Start or Clone a Repository and Git Settings.
Manage Remotes
Choose Git > Remotes… to open the Remotes window. It lists the repository’s remotes with their URLs. Type in the Filter remotes… field to shorten the list.
- To add a remote, click the + button (Add Remote). Enter a name, such as
upstream, and a URL, then click Add. - To change a remote’s URL, double-click it, or right-click it and choose Edit URL…. Enter the new URL and click Save.
- To rename a remote, right-click it, choose Rename…, enter the new name, and click Rename.
- To delete a remote, right-click it and choose Delete Remote. Click Delete to confirm.
Click the close button to close the window.
Tags
Choose Git > Tags… (default ⌘⇧T) to open the Tags window. Type in the Filter tags… field to shorten the list.
- To create a tag, click the + button (New Tag). In the Create New Tag dialog, enter a name, such as
v1.0.0. Add a message to make an annotated tag, or leave it empty for a lightweight tag. Click Create. The tag points to the current commit. - To check out a tag, select it and click the check mark button (Checkout Tag (Detached HEAD)), press Return, or double-click it. Aember warns that the repository will be in a detached HEAD state: commits you make there do not belong to any branch until you create one. Click Checkout to go on.
Right-click a tag to see its name, commit, and message, and these items:
- Push Tag pushes the tag to the remote.
- Push All Tags pushes every tag.
- Delete Tag deletes the tag after you confirm.
The push items are available when the repository has a remote.
Worktrees
A worktree is another folder with its own checked-out branch of the same repository. Choose Git > Worktrees… to open the Worktrees window. It lists the main worktree and the linked worktrees, with the branch each one has checked out. Labels show which worktree is the main one, which is open, and which are locked or missing.
- To add a worktree, click the + button (New Worktree). Enter a branch and a directory, then click Create. An existing local branch is checked out in the new worktree. Any other name creates a new branch from the current commit.
- To open a worktree as this window’s project, double-click it, or select it and click the check mark button (Open Worktree as Project).
Right-click a worktree for these items:
- Open as Project, Reveal in Finder, and Copy Path.
- Lock Worktree… keeps the worktree when missing worktrees are pruned. You can enter a reason. Unlock Worktree removes the lock.
- Remove Worktree… deletes the worktree’s directory and keeps its branch. If the worktree has uncommitted changes, Aember asks again before it removes it. You cannot remove the worktree that is open.
- Prune Missing Worktrees removes the records of worktrees whose directories are gone.
The main worktree cannot be locked or removed.
Reflog
The reflog lists the earlier positions of HEAD. Use it to get back to a state after a reset or rebase that went wrong.
Choose Git > Reflog… to open the Reflog window. Type in the Filter reflog… field to shorten the list.
Double-click an entry to check it out. Aember warns that the repository will be in a detached HEAD state. Click Checkout to go on, or click Create Branch… to make a branch at that point instead.
Right-click an entry for these items:
- Checkout (Detached HEAD) checks out the entry.
- Create Branch Here… creates a branch at the entry. Enter the branch name and click Create.
- Copy Commit Hash copies the entry’s commit hash.
Click the close button to close the window.
Find a Bug with Bisect
Bisect finds the commit that introduced a bug. It checks out commits between a good commit and a bad commit, and you test each one. Each answer halves the commits that are left. Bisect checks out other commits in your working tree, so commit or stash your changes before you start.
Start
- Choose Git > Bisect…. The Start Bisect window opens.
- In Bad commit (has bug):, keep
HEADor enter a branch, tag, or commit hash. - In Good commit (no bug):, enter a commit where the bug is not present. This field is required.
- The Select… menus beside the fields list your Branches and Tags. Choose one to fill in the field.
- Click the check mark button or press Return.
Test each commit
The Git Bisect window shows about how many steps remain, and the Current Commit: with its hash and message. Test the commit, then click one of the buttons:
- Mark as Good (bug not present)
- Mark as Bad (bug present)
- Skip this commit (cannot test)
The History: list shows each commit you marked. When bisect finds the commit, the Bisect Complete dialog shows it. Click Reset Bisect in the dialog and confirm to end the session, or click OK to keep it.
End the session
Click the Reset Bisect button and confirm to end the session and return to your original branch. The close button closes the window and leaves the session running. Choose Git > Bisect… to open it again. The session is stored where git keeps it, so you can also continue it from the command line.
Blame
Blame shows which commit last changed each line.
Choose View > Show Blame (default ⌥⌘B) to show or hide blame in the active editor’s gutter. A check mark shows when blame is on. You can also right-click the gutter and choose Blame. Blame is on in that editor only, and the file reopens with blame on if it was on when you closed it. Lines from the same commit are joined by a bracket. An icon marks the first line of each block.
- Hold the pointer over an icon to see the commit hash, author, and date.
- Click an icon to open Git History with that commit selected. See Browse Git History.
Blame follows the text in the editor, including changes you haven’t saved. Lines that are not committed yet are shown as uncommitted changes.
Blame works for files in the project’s repository. For a file outside it, such as one opened from another folder, Aember tells you the file is not in a git repository.
Who wrote each line
Git names the person who made each commit, even when an agent wrote the code. History records who made every change, so blame adds what it knows:
- Committed lines an agent wrote get a bracket and icon of their own. A new bracket starts wherever the commit or the agent changes. Hold the pointer over a line to see who wrote it and when, besides the commit.
- Uncommitted lines are split into blocks by who wrote them: you, an agent (each conversation separately), or another program. The block’s icon shows which.
- If you changed a line an agent wrote, the line is yours, and its tooltip says who wrote it first.
- Click an agent’s icon to open the file’s History at the moment the agent wrote the line. For Cogitae’s changes, a menu also offers Show in Cogitae, which opens the message that asked for them.
Where History has no record, as for a file never opened in Aember, blame shows git alone. History is kept on your Mac, so others who blame the file see git alone too. For lines from History recorded before this version and thinned since, blame may name the wrong author.
Git LFS Files
Git LFS stores large files outside the repository. Until you download a file, the repository holds only a small pointer to it.
When you open a file whose content is not downloaded, Aember asks whether to download it. Click Download, or Not Now to leave the pointer.
To download the content of every LFS file in the repository, choose Git > Download LFS Files. The status bar shows the progress.
Both need the git-lfs tool. If it is not installed, Aember explains how to install it, for example with Homebrew. If it is installed but not set up, Aember offers to set it up. Click Set Up and Download.
LFS downloads and uploads use the repository’s persona, like Aember’s other remote operations. See Fetch, Pull, and Push.
Unsaved Changes and History Checkpoints
Git works with the files on disk. Your unsaved changes are in Aember’s editors and in History, not on disk. Before some git operations, Aember asks what to do about files with unsaved changes. If no file has unsaved changes, it asks nothing.
Operations that read files
Before you stage, commit, or stash, unsaved changes would be left out. The dialog is Save Changes Before Staging?, Save Changes Before Committing?, or Save Changes Before Stashing?. It has these buttons:
- Save saves the files, then goes on. If a file can’t be saved, the operation stops.
- Don’t Save goes on without the unsaved changes.
- Cancel stops.
Operations that overwrite files
Switching branches, checking out a tag or reflog entry, resetting the branch, merging, rebasing, pulling, each bisect step, applying a stash, and cherry-picking can overwrite files on disk. The Files Have Unsaved Changes dialog has Save and Continue, Continue, and Cancel. Save and Continue stops if a file can’t be saved. If you continue without saving, the unsaved changes stay in Aember: in their editors if the files are open, and in History if History records them.
Checkpoints
When History is on, it records every git operation that Aember runs. Before an operation that can rewrite files, History records the current contents of every file with uncommitted changes, untracked files included. These operations include switching branches, checkouts, merges, rebases, pulls, cherry-picks, reverts, aborts, stashes, applying stashes, hard resets, and Restore from Repository…. If git overwrites your work, restore it from History. See Restore an Earlier Version.
After each operation, History adds a marker to its timeline, such as “Switched to main” or “Committed”. History also notes branch changes made outside Aember.