- On your computer, create a GitLab project and push the vault to it, so the project root is the vault root.
- Create a personal access token with
read_repositoryandwrite_repository, or add an SSH key to your GitLab account. - In GitSync.md, add the repository by URL (Enter URL Manually on iPhone and iPad, Any Git host on Android).
- Clone it into the folder Obsidian uses.
- Open that folder as a vault in Obsidian, then pull, edit and push.
This works the same on gitlab.com and on a self-managed GitLab server. GitSync.md runs real Git on the phone, so the GitHub sign-in and the GitHub-only tools on this site don’t apply here: you give it a GitLab remote URL and a token or key instead. Get GitSync.md for iPhone and iPad → · Get it on Google Play →
Before you start
- A GitLab project that holds the vault. Create it and push the vault from your computer first. The project root should be the vault root, the folder that contains
.obsidian. - GitSync.md and Obsidian on the phone. GitSync.md needs iOS or iPadOS 17 or later, or Android 9 or later.
- A
.gitignorethat keeps device state out. Obsidian rewrites.obsidian/workspace.jsonas you move around, which would make a commit every session. Generate a file with the Obsidian .gitignore generator before the first push. - A backup. Keep an independent copy of the vault before you change how it syncs. Back up an Obsidian vault with Git explains why sync and backup aren’t the same thing.
If the project contains a folder named after the vault, and the notes are inside it, Obsidian may open the wrong level. Push a project whose root is the vault, or open the subfolder deliberately.
Only one app should run Git on the vault at a time. Turn off any other sync tool for this vault on the phone first. Not sure Git is the right method? See the Obsidian Sync alternatives.
Choose an HTTPS token or an SSH key
| HTTPS token | SSH key | |
|---|---|---|
| Setup | Create a token in GitLab, paste it into the app | Make an Ed25519 key, add the public half to GitLab, give the private key to the app |
| Expiry | Expires. GitLab’s default is 365 days, so calendar a renewal | No expiry of its own, unless you set one in GitLab or remove the key |
| First connect | Nothing extra | Check the server’s host-key fingerprint, then trust it once |
| Works with the Obsidian Git plugin on mobile | Yes | No, the plugin’s docs say SSH isn’t supported on mobile |
| Self-managed GitLab | https://git.example.com/group/vault.git | ssh://git@git.example.com:2222/group/vault.git if SSH uses a custom port |
A token is simpler. An SSH key is worth it if you already use one or don’t want a token to renew. For a token limited to one vault, GitLab also documents project access tokens, which belong to a single project instead of your account. Check that page for which plans and roles can create them.
Create a GitLab personal access token
These steps follow GitLab’s personal access token documentation. Menu names can shift between GitLab versions, so use that page if yours differs.
- In GitLab, open your avatar, then Edit profile, then Personal access tokens.
- Choose to add a new token and give it a name such as
obsidian-phone. - Set an expiry date. Tokens expire: the default is 365 days, and you can choose a shorter life.
- Select the scopes
read_repositoryandwrite_repository. Read lets the phone clone and pull. Write lets it push. Nothing else is needed for Git. - Create the token and copy it right away. GitLab shows it once.
The username isn’t checked for a personal access token over HTTPS: any non-empty value works, per the same documentation. GitSync.md’s HTTPS form needs a username, so type your GitLab username or anything else. Never paste the token into a note: it would be committed with the vault.
https://gitlab.com/you/vault.git
https://git.example.com/group/vault.git
Or add an SSH key
GitLab’s SSH key documentation covers key types and where to add them. In short:
- Create an Ed25519 key in OpenSSH format. On a computer,
ssh-keygen -t ed25519 -C "obsidian-phone"writes a private key and a.pubpublic key. On Android, GitSync.md can also make a key on the phone and copy its public half. - In GitLab, open your avatar, then Edit profile (or Preferences), then SSH Keys, and add the public key. Never upload the private one.
- Keep the private key somewhere you can reach from the phone for the next step, and give it a passphrase if you can.
The remote URL has two forms:
git@gitlab.com:you/vault.git
ssh://git@git.example.com:2222/group/vault.git
Use the ssh:// form when a self-managed server listens on a custom port. The git@host:path form can’t carry a port. See self-hosted Git with SSH on iPhone and iPad for more on SSH remotes.
iPhone and iPad: clone the vault with GitSync.md
Add the repository by URL
Tap Add Repository, then Enter URL Manually, and paste the GitLab remote URL. Under Authentication, choose HTTPS Token/Password and enter a username plus your token, or SSH Private Key and paste your OpenSSH private key and passphrase. Set your author name and email: they go on every commit. Credentials are stored in the iOS Keychain.
Save into Obsidian’s folder
Set the save location to On My iPhone → Obsidian (on iPad, On My iPad → Obsidian), so the cloned folder is ready to open as a vault.
Trust the host key (SSH only)
On the first SSH connection, GitSync.md shows the server’s SHA-256 fingerprint. For gitlab.com, compare it with the list in the SSH host keys fingerprints section of GitLab’s gitlab.com documentation. For a self-managed server, compare it with a fingerprint your administrator gives you. Tap Trust Host only if it matches. GitSync.md pins it per host and port and retries the clone.
Clone
Start the clone. GitSync.md writes the files and the full .git directory to the folder you chose. For the general clone flow, see the Obsidian Git on iPhone and iPad guide.
Android: clone the vault with GitSync.md
On the first screen, choose SSH, token or another host to open Any Git host. Paste the GitLab remote URL, then choose Token or SSH key. For a token, enter the username and the token. For SSH, either tap Copy public key after the app makes a key, and add that to GitLab under SSH Keys, or import an existing key file. Confirm the server’s SSH host key when asked, after comparing the fingerprint as described above. Then use Test & clone.
Android needs the vault to land in a device folder that Obsidian can open, such as Documents/Obsidian, and it needs storage access for that. The Android guide walks through the folder steps, the vault check and the price prompt, so they aren’t repeated here.
Open the folder as a vault in Obsidian
In Obsidian’s vault picker, choose Open folder as vault and select the folder GitSync.md cloned, the one that contains .obsidian. If your .obsidian settings are committed, themes and plugin settings come along. If notes don’t show up, you’ve probably opened a parent or sibling folder.
Who runs Git: GitSync.md or the Obsidian Git plugin?
Recommended: let GitSync.md own Git on the phone. It runs native Git, so SSH works, and you get pull, commit and push controls plus a diff view. From Obsidian, a link such as the one below pulls, commits and pushes in one go. Replace MyVault with the vault folder name shown in GitSync.md.
syncmd://x-callback-url/sync?repo=MyVault&message=Update%20from%20Obsidian
On iOS, the same actions are available from Apple Shortcuts.
You can run the Obsidian Git plugin on the phone instead, but its documentation lists limits on mobile: no SSH authentication, the isomorphic-git implementation, limited repository size, no rebase merge strategy, and the mobile mode is marked unstable. With the plugin, use HTTPS: your GitLab username plus a personal access token, with the scopes above. GitSync.md Connect, the companion that hands a sign-in to the plugin, is GitHub-only, so it doesn’t help with GitLab.
If the plugin runs Git, don’t also run GitSync.md’s pulls, pushes or automation on the same vault. Two Git clients on one folder is how duplicate commits and conflicts start. If you want the plugin as a backup route, leave its auto-sync off.
Verify the first round trip
- On your computer, edit a test note such as
Phone test.md, commit and push it to GitLab. - On the phone, pull in GitSync.md and open the note in Obsidian. The change should be there.
- Edit the note on the phone, then commit and push in GitSync.md.
- In GitLab, open the project’s Code → Commits list and confirm the new commit and the note’s contents. Pull on the computer to see it there too.
Turn on any automation only after both directions work by hand. If something fails, start with Obsidian Git not working on iPhone.
Troubleshooting
HTTP 401 or 403
The token is missing a scope or has expired. Check that it has read_repository and write_repository, and look at its expiry on GitLab’s personal access tokens page. Make a new token and update it in the repository’s settings in GitSync.md. Also confirm the username field isn’t empty.
Push rejected on a protected branch
Your account’s role or the branch’s rules don’t allow you to push. GitLab’s protected branches documentation explains that a protected main restricts who can push. For example, members with the Developer role can’t push directly if only Maintainers are allowed. GitSync.md verifies pushes, so a rejection appears as an error instead of fake success. Ask a maintainer to change the rule, or push to another branch and merge it in GitLab.
SSH key rejected
The key is valid but GitLab doesn’t know it. Confirm the public half is added under your account’s SSH Keys, and that the passphrase, if any, is right.
Host key changed
Treat this as a security event, unless you know the server was migrated or its keys rotated. GitSync.md blocks the connection instead of continuing. Verify the new fingerprint through GitLab’s published list or your administrator before trusting it.
A custom SSH port is ignored
Use the full form: ssh://git@git.example.com:2222/group/vault.git.
Large attachments
Big images, PDFs and video bloat a vault’s history. Read Git LFS on iPhone and iPad before you add many of them.
Conflicts
Pull before editing on each device. If two devices changed the same note, follow the conflict recovery guide.
FAQ
GitHub or GitLab for an Obsidian vault?
Either works. Both host private repositories, and GitSync.md treats them as ordinary Git remotes. Pick the one you already use or the one your team runs. GitHub has the faster setup in GitSync.md, because it can sign in and browse your repositories; see Sync Obsidian with GitHub on every device. Check each host’s current terms for storage and repository limits.
Can I publish notes from GitLab?
GitLab has a static site feature, GitLab Pages. This site’s Quartz tutorial is built on GitHub, so treat it as a similar idea rather than a GitLab walkthrough.
Does it work with self-managed GitLab?
Yes. Use your server’s URL, an HTTPS token or an SSH key, and the ssh:// form for a custom port.
Can I use a project access token?
Yes. GitLab’s project access tokens work over HTTPS like a personal one. Choose the repository read and write scopes, and check that page for the role needed.
Recap
Push the vault to a GitLab project, make a token with read_repository and write_repository (or an SSH key), add the URL in GitSync.md, clone into Obsidian’s folder and open it as a vault. Let GitSync.md own Git, check SSH host keys against GitLab’s list, and test a round trip. For comparisons and routines, see Obsidian Sync alternatives and backing up a vault with Git.
Real Git for your GitLab vault on iPhone and iPad → · Android on Google Play → $9.99 once.
