Set up GitHub with SSH on iOS

  1. Install iSH Shell
    Download iSH Shell from the App Store and open it.
  2. Install Git and OpenSSH
    In the terminal, run:
    apk add git openssh
  3. Set Git username
    git config --global user.name "Your Name"
  4. Set Git email
    git config --global user.email "your_email@example.com"
  5. Generate a new SSH key
    Replace the email with your own:
    ssh-keygen -t ed25519 -C "your_email@example.com"
  6. Start the ssh-agent
    eval "$(ssh-agent -s)"
  7. Add your SSH private key to the agent
    ssh-add /root/.ssh/id_ed25519
  8. Copy your public key
    Display your public key and copy the output:
    cat /root/.ssh/id_ed25519.pub
  9. Add the key to GitHub
    Go to GitHub’s “Add new SSH Key” page, give it a title, and paste the public key into the Key field.

Done! Your iOS device is now set up to use Git over SSH. You can clone, push, and pull repositories securely right from your iPhone or iPad.