Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    SSH GitSync

    Scheduled Pinned Locked Moved Development
    1 Posts 1 Posters 638 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NOYB
      last edited by

      To use SSH for gitsync rather than the GIT protocol.

      1. Place the OpenSSH private key file in the /root/.ssh directory similar to this example and set permissions to either 0000 or 0400.  If permissions are too open it will be rejected.
      
      /root/.ssh/MYGIT_OpenSSH_Private_Key
      
      
      1. Create the file /root/.ssh/config with content similar to this example.
      
      # GitHub git/MYGIT account
      Host github.com-git
          HostName github.com
          User git
          IdentityFile ~/.ssh/MYGIT_OpenSSH_Private_Key
      
      
      1. SSH gitsync should now work with a playback command similar to this example.
      
      playback gitsync --minimal --diff --show-files --dry-run git@github.com-git:MYGIT/pfsense.git master
      
      

      This can also be used with a personal private git server to avoid running a git daemon that exposes the repos to the world.

      Notes:
      Replace "MYGIT" with user name.
      The "Host" is case sensitive.
      The "-git" suffix can be omitted from the host.  It is used in examples for clarity.
      If the user ID (git@) is omitted from the playback command URL, then the "User" ID specified in the config file will be used.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.