Source control and GitHub
Stage, commit, branch, push, pull, and publish to GitHub.
Source Control works with Git, and so with any remote: GitHub, GitLab, your own server. Open it with CtrlShiftG, the branch icon in the activity bar, or View → Source Control. Git must be installed on your computer.
The toolbar
| Control | What it does |
|---|---|
| Branch name | Opens the branch switcher. |
| ↓ Pull | Fetch and merge changes from the remote. |
| ↑ Push | Send your commits to the remote. With no remote yet, it publishes to GitHub instead. |
| GitHub icon | Sign in to GitHub, or sign out. |
| ↻ Refresh | Re-read the repository's state, for example after running git in a terminal. |
If something fails, such as a rejected push or a merge conflict, the error appears above the file list.
Review, stage and commit
- Changed files are listed by section: staged changes and other changes, each with its status (Modified, Added, Deleted, Renamed, Untracked, Conflict). Click a section title to fold it.
- Click a file to see its diff.
- Stage the files you want in the commit, or unstage them.
- Type a message in the box and press CtrlEnter or click Commit. The button is enabled once something is staged and the message isn't empty.
Discard reverts a file to its last committed version, or deletes it if it was never committed. Lamied asks first, because this can't be undone.
Branches
Click the branch name, in Source Control or at the left of the status bar, to open the switcher:
- pick a branch to switch to it;
- or choose Create new branch… and enter a name, such as
feature/my-change. It's created from the current branch.
If switching would overwrite uncommitted changes, Lamied offers Stash Changes and Switch. Your changes are saved in a Git stash, not lost; bring them back later with git stash pop.
Sign in to GitHub
- Click the GitHub icon in the Source Control toolbar.
- Lamied opens
github.com/login/devicein your browser and shows you a code. - Enter the code on GitHub and approve access. Lamied continues as soon as you do.
To sign out, click the GitHub icon again. GitHub sign-in is separate from your Lamied account and doesn't affect Pro.
Publish a project to GitHub
For a project with no remote yet:
- Click ↑ Push. It becomes Publish to GitHub. Sign in first if asked.
- Enter a repository name (letters, numbers,
-,_and., up to 100 characters). - Choose public or private.
- Lamied sets up Git if the folder isn't a repository yet, creates the repository on GitHub, and pushes. Progress shows in the panel and the status bar, and ends with a link to your new repository.
GitHub Actions
Ask the assistant to create or edit a workflow in .github/workflows/, review it, then commit and push. GitHub runs it; see the results in your repository's Actions tab.