Skip to content

Add support for SSH authentication #36

@pranavmangal

Description

@pranavmangal

Thanks for building git-sync! I have looked for something like this in the past and am glad that it now exists.

Currently git-sync only supports HTTP based auth and I would love for it to support SSH. The nice thing about SSH is that it avoids having to set up individual access tokens (along with their necessary scopes, perms, expiration) for any forges that I might want to use with git-sync - it can instead read my existing SSH config and automatically determine the appropriate key to use for a given forge.

I had an agent have a crack at this and after a bunch of back and forth, it seems to have made a working implementation. The implementation abstracts the transport layer into a new interface and supports SSH auth by using the local ssh binary.

I tried testing it manually by syncing some repos between GitHub and GitLab and it worked as expected. It was a simple:

git-sync sync "git@github.com:user/repo.git" "git@gitlab.com:user/repo.git"

The implementation is far from mergeable right now, but if the maintainers are open to adding SSH support to git-sync, I can take a proper look at it, clean it up and try opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions