Remote git
The Git button on the top bar shows your project folder’s own checkout against its remote. Everything in it acts on the project folder, never on a terminal’s worktree. For a terminal’s own branch, see Auto git and worktrees.
Opening the popup
Click Git on the top bar and the popup opens under it. It stays open until you click elsewhere or press Escape. The Terminals view has the same button, with a project picker inside the popup to choose which project it shows.
The head reads Remote, where a terminal’s own popup reads Local. Here, Push means pushing to the remote repository.
Where the branch stands
Beside the head is one line comparing the checked out branch with its branch on the remote, for example 2 behind, 1 ahead of origin/main. The numbers are as of the last fetch.
- A repository with no remote reads No remote, and the commands do nothing.
- A remote branch that has never been fetched or pushed reads
origin/main not fetched yet, instead of pretending the two match. - A folder that is not a repository reads Not a git repository.
The remote used is the one the branch is set to track, else origin, else the first remote the repository has.
The commands
| Command | What it does |
|---|---|
| Commit | Commits every change the popup lists, staged, unstaged and new files alike. A box opens over the change lines for the message. Nothing is pushed. |
| Push | Pushes the branch to the remote, and sets it to track the remote branch the first time. If the remote branch has new commits, the note asks you to pull first. |
| Pull | Fetches the remote branch and merges it into the local one. |
| Squash | Folds the commits the remote does not have yet into one, keeping the newest commit’s message. It refuses while the branch is behind, since rewriting over remote work you have not pulled would quietly undo it. It also needs the remote branch to exist, so push or pull once first. |
With more than two commits to fold, Squash first opens a list of how many to fold, from the newest two up to all of them, for example Top 2 commits, Top 3 commits and All 4 commits.
Every command reports in a note under the head, for example pulled 3 commits from origin/main, pushed 1 commit to origin/main or squashed 3 commits.
Uncommitted changes
Pull and Push follow the same settings as a terminal’s popup, Uncommitted changes on Pull and Uncommitted changes on Push in Settings > Git. Each is Ask, Leave Modified or Commit, and Ask is the default.
With Ask, nothing runs until you answer. The popup says how many files are modified and offers Leave Modified, Commit, and Amend Last Commit when there is a commit to fold them into. Leave Modified sets the files aside during the command and puts them back after.
If a pull’s merge conflicts, the fallback model resolves it. If it cannot, the merge is undone and the note names the conflicted files, so your checkout is left as it was.
Changed files
Under the head are the staged and unstaged change lines. Each names the first file and counts the rest, and pointing at the count names them all. Clicking a line opens that file’s uncommitted diff in the review window. The x on a line throws away that one file’s uncommitted changes. A file the last commit knows goes back to that version, and a new file is removed.
The commit rail
Below the changes is a rail with the branch’s five newest commits, newest on top. Clicking a commit opens its changed files in the review window.
Double-click the newest commit to reword it, or press its x to undo it, which leaves everything it changed as unstaged edits. Both work only on a commit the remote does not have yet, because rewriting one the remote already has would leave a push the remote refuses. A merge commit cannot be undone here, because undoing it would mean picking one of its two sides.