Git in the desktop app vs the browser¶
Audience: anyone whose push, pull or commit fails · ~4 min read · Prerequisites: Source Control pane
What it is¶
The Source Control pane is the same in the browser IDE and in the desktop (Electron) app. In both, the pane
sends its requests to the IDE backend, and the backend runs the real git program. Only where the backend
runs differs.
| Browser IDE | Desktop app | |
|---|---|---|
Where git runs |
On the machine running npm start (maybe a server, not your laptop) |
On your own computer |
| Whose files and credentials | The user the backend runs as | You |
| Git must be installed | On that machine | On your computer |
When you'd use it¶
- Push or pull fails or hangs.
- You open the IDE from another computer and the repository "is not there".
Things to know¶
- Git runs as the backend's user. The folder,
~/.gitconfig(name, e-mail), SSH keys and credential helper that count are the backend machine's, not your browser's machine. - There are no password prompts. Commands run without a terminal. A push that waits for a password is stopped after 60 seconds (local commands after 10 seconds). Set up an SSH key, a credential helper or a token first, and test it in the IDE's Terminal.
- Set your identity before the first commit (
git config user.name/user.email), or the commit fails with git's own message in the pane. - Security limits. Git runs with
core.fsmonitoroff, hooks only where expected, and only inside allowed folders. See Security and privacy. - The standalone webview preview (
npm run dev, no backend) has no git at all. - After Pull, branch switch, merge, revert, reset, stash apply or Abort merge, open models are re-checked against the disk so a stale editor does not save over the change.
- Commit and Amend… first save the pending edit of every open model, in the browser IDE and in the desktop app alike.
I could not verify the Electron behavior on a packaged build; the code path is the same extension.
Every control¶
| # | Button/Option | What it does | Shortcut | Gotcha |
|---|---|---|---|---|
| 1 | ⇣ Fetch / ⇩ Pull / ⇧ Push | Run git fetch/pull/push on the backend machine. |
Credentials must already work there. | |
| 2 | Enable version control for new projects | New projects get git init and an "Initial commit". |
Preference; on by default. Needs real file system and git. |