Alternative way of git syncing on iOS using a-shell for free

Hi,

I just wanted to highlight that there is another way of git syncing on iOS for free than Working Copy. Working Copy is likely worth it but didn’t want to go that path yet :slight_smile:

There’s a terminal program on iOS “a-shell”. a-Shell

This has a minimalistic git functionality based on the libgit library (GitHub - libgit2/libgit2: A cross-platform, linkable library implementation of Git that you can use in your application.) through a lg2 command line.

The recipe that I got working was:

  • create keypair for ssh as described in github

  • go to logseq dir in iCloud using pickFolder command

  • lg2 clone git@github.com:yourrepo.git

  • lg2 config user.email name@here.there

  • lg2 config user.email name@here.there

  • do your logseq edits on iPad

  • lg2 add filename

  • lg2 commit -m “message”

  • lg2 push

A bit of messing about with command line on iPad but seems to work.

Hi,
Does a-shell provides actions for autoamtion/shortcuts? If so, we can make it more seemlessly when working with logseq!

Hi,

Yes a-shell does provide a shortcuts interface for running scripts so I think that should be doable. I Did some initial tests, and it does run git, but one needs to ensure all is scripted and no manual inputs etc.

1 Like

hi, I used ssh-key with lg2 command. But it always asks password for lg2 pull or lg2 push. And I need to input empty just by entering enter. The ssh-key is sshkey-gen with emtpy password.
Do your have the same preblem? Thx.

Hi, when I use lg2 push it asks for password but no matter how many times I press enter it is stuck

1 Like

@yestin_chen @Sai_Kiran Maybe u can take this as reference.

Same problem. I get stuck in a loop requesting SSH Key and Password. Charles Chiu’s guide omits a step. You need to add your public key in GitHub’s SSH keys. Adding a new SSH key to your GitHub account - GitHub Docs. went to the directory where the SSH key was located and “cat .pub”, copied the output, emailed it to myself and pasted it into GitHub.

This is the tutorial I followed for a-shell if that helps?

Unable to get this working as git clone keeps failing for me. I configure the .gitconfig file but upon running the clone command, I keep getting the below error:

Cloning into ./logseq-notes.git
ERROR 7: failed to parse config file: unexpec
ted character in header (in /private/var/mobi
le/Containers/Data/Application/07749287-812B-
421E-83B6-C4FEB33BF1C0/Documents/.gitconfig:1
, column 9)
Bad news:
 failed to parse config file: unexpected char
acter in header (in /private/var/mobile/Conta
iners/Data/Application/07749287-812B-421E-83B
6-C4FEB33BF1C0/Documents/.gitconfig:1, column
 9)

Totally scratching my head!!!

I see a number of posts online about syncing via git and github, but in doing it via this manner (including using the helper files in Charles Chiu’s git repository) all of your data is being committed in Git and pushed to your Github repo online unencrypted.

Here is one of the few messages I’ve seen that deals with this, from the Obsidian community

[Mobile] Sync with git on iOS for free using iSH - #17 by evergreensnow - Share & showcase - Obsidian Forum.

Please don’t push your data unencrypted unless you have a very clear understanding of what that implies.

hi ! I am trying to use a-shell with git bue I am unable to start the ss-agent because eval errors not found.

Have you encounter this issue ?

thanks !