Skip to main content
Lectra includes Git, so you can keep a history of your project, clone a course’s starter code, and push your work to GitHub from your iPad. You can use Git with buttons in the code editor or with the git command in the terminal. Commits, staging, branches, and diffs work offline. Cloning, pulling, and pushing need an internet connection.

Before you begin

  • To use Git on your own projects: nothing extra.
  • To clone private repositories or push to GitHub: sign in to Lectra, and then connect your GitHub account, as described in Connect GitHub.
  • Remotes must use HTTPS: addresses that start with https://. SSH addresses, such as git@github.com:…, aren’t supported.

Connect GitHub

Lectra uses your GitHub access to list your repositories, clone private ones, and push. You need to be signed in to Lectra first. You can connect from either of these places:
  • The Clone a Repo sheet: in your library, tap Projects > New > Clone a Repo.
  • The terminal: tap Connect GitHub in the terminal’s header.
Then choose how to connect:
Tap Connect with GitHub, sign in to GitHub, and allow access. When you return to Lectra, your repositories load.
When GitHub is connected, the terminal’s header shows GitHub with a green dot. Lectra keeps your GitHub access on this iPad, for your Lectra account only. If you sign out of Lectra, it stops using it. To remove access completely, revoke it or delete the token in your GitHub account settings.
Lectra uses your GitHub access only for repositories on github.com. You can clone public repositories from other sites with git clone in the terminal, but you can’t push to them.

Clone a repository

1

Open Clone a Repo

In your library, tap Projects > New > Clone a Repo.
2

Pick a repository

After Loading your repositories…, tap a repository in the list. A lock marks private ones.
3

Open it

When cloning finishes, the repository appears in the Projects tab. Tap it to open it in the code editor.
This copies only the latest version of the repository’s default branch, without its earlier history. To get the full history or another branch, use git clone in the terminal.

Set your name for commits

Each commit records who made it. Unless you set your name, Lectra records commits as “Lectra”. To use your own name and email, open the project’s terminal and type:
Set these once in each repository. Lectra doesn’t support git config --global.

Commit changes in the code editor

1

Open Source Control

In an open project, tap Source Control (the branch button) in the top bar, or press Control Shift G.
2

Start tracking, if needed

If the panel says Not tracked yet, tap Start Version Control. Lectra starts keeping a history of the project.
3

Review your changes

Changed files are listed under Changes. Tap a file to see what changed in it.
4

Stage files

Tap + (Stage) next to each file you want to include. It moves to Staged Changes. Tap − (Unstage) to take it back out.
5

Commit

Type a description in Commit message, and then tap Commit followed by the number of files. When nothing is left to commit, the panel says Working tree clean.
To switch to another branch that already exists, use the branch menu at the top of the panel. To create a branch, use git switch -c branch-name in the terminal.

Sync with GitHub

Sync to GitHub saves your work to GitHub in one step. It commits every change in the project, gets any new changes from GitHub, and then pushes.
1

Open the project

Open a project that you cloned from GitHub.
2

Tap Sync to GitHub

Tap Sync to GitHub (the circular arrows) in the top bar. You can also choose Sync with GitHub in the command palette.
3

Check the result

Lectra shows Synced when it’s done, or Couldn’t Sync with the reason.
Sync commits with the message “Sync from Lectra” followed by the date. If you want your own commit messages, commit in Source Control first, and then sync. If GitHub has changes that conflict with yours, sync stops and says “Sync paused: changes on GitHub conflict with local edits.” Open the project’s terminal, type git status to see the conflicting files, fix them, and then sync again.

Use Git in the terminal

The terminal’s git command supports these subcommands: To learn more about the terminal, see Use the terminal.

Limits

  • Remotes must use HTTPS. SSH remotes aren’t supported.
  • rebase, stash, merge, submodules, and Git LFS aren’t available.
  • git pull in the terminal works only when it doesn’t need to merge. Sync to GitHub can merge.
  • Settings apply to one repository at a time. --global and --system aren’t supported.
  • Lectra can push only to github.com.
  • The Source Control panel commits and switches branches. To pull or push, use Sync to GitHub or the terminal.
If you need full Git, you can connect to another computer with ssh from the terminal. To learn how, see Use the terminal.

Troubleshooting

Connecting GitHub needs a Lectra account. Sign in to Lectra, and then connect GitHub again.
Use the repository’s HTTPS address instead. To change an existing remote, type git remote set-url origin https://github.com/username/repository.git.
Sync to GitHub needs a remote named origin. In the project’s terminal, type git remote add origin followed by the repository’s HTTPS address.
Make sure GitHub is connected. The terminal’s header shows GitHub with a green dot when it is. If you use a personal access token, check that it can access the repository.
That Git command isn’t available on the iPad. Check Limits for alternatives.

Use the code editor

Edit project files and use Source Control.

Use the terminal

Run git and other commands.