UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Cannot git clone from my own repo

    Scheduled Pinned Locked Moved Solved Support
    5 Posts 3 Posters 1.4k Views 2 Watching
    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.
      • R Online
        RJDan
        last edited by RJDan

        I am trying to clone the documentation for ubports to my phone (desktop mode) to edit locally.
        I have forked the docs on gitlab, I created the ssh keys on the phone (Wth passphrase) and I have added the public key to gitlab.
        I ran the command below to test the connection. It worked after I entered the passphrase for the key.

        ssh -T git@gitlab.com 
        

        but when i try to clone my fork with this

        git clone git@gitlab.com:MyUserName/docs.ubports.com.git
        

        I get the following

        Cloning ....
        load key ... : Permission denied (publickey).
        fatal: Could not read from remote repository.
        

        I can clone public repos ... so it is not an issue with connecting to gitlab.
        Any advice?

        arubislanderA 1 Reply Last reply Reply Quote 0
        • R Online
          RJDan @k.nacke
          last edited by

          @k.nacke
          Sorry, there were snap connections that I had not set, so git-confined could not access the ssh keys. I have corrected it now and it works.
          I have successfully cloned the docs repo.

          1 Reply Last reply Reply Quote 0
          • arubislanderA Offline
            arubislander @RJDan
            last edited by arubislander

            @RJDan

            Could you try explicitly referencing the key file with the clone?

            git clone -c core.sshCommand="ssh -i ~/.ssh/my_gitlab_ssh_key" \
                      git@gitlab.com:MyUserName/docs.ubports.com.git
            

            πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
            Happily running Ubuntu Touch
            JingPad (24.04-1.x daily)
            OnePlus Nord N10 5G (24.04-2.x daily)
            PinePhone OG (20.04)
            Meizu Pro 5 (16.04 DEV)

            R 1 Reply Last reply Reply Quote 1
            • R Online
              RJDan @arubislander
              last edited by

              @arubislander
              No luck. I get the same message when I specify the key as you suggested. I would guess it needs my passphrase but does not prompt me for it. What agent thing does UT use for secrets?

              1 Reply Last reply Reply Quote 0
              • K Offline
                k.nacke
                last edited by

                One way to debug this is to see what ssh is doing:

                GIT_SSH_COMMAND="ssh -v" git clone git@gitlab.com:MyUserName/docs.ubports.com.git
                
                
                R 1 Reply Last reply Reply Quote 1
                • R Online
                  RJDan @k.nacke
                  last edited by

                  @k.nacke
                  Sorry, there were snap connections that I had not set, so git-confined could not access the ssh keys. I have corrected it now and it works.
                  I have successfully cloned the docs repo.

                  1 Reply Last reply Reply Quote 0
                  • R RJDan has marked this topic as solved on
                  • KenedaK Keneda has marked this topic as solved on

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better πŸ’—

                  Register Login
                  • First post
                    Last post