Use Git Credential Manager for GitHub access(Ubuntu)

Steps

1. Down load the install file (gcm-linux_amd64.2.6.1.deb) from  GCM_DOWNLOAD and install it

2. sudo apt-get install pass

3. git config --global credential.credentialStore gpg

4. gpg --gen-key

   Follow the promotion’s guidance generate the key and user id, this user id will be used as gpg-id

5. pass init <gpg-id>

   use the user id generated in step 4, be aware that we must use quotation mark around this gpg-id

6. git push, and a hyperlink to the github website will be generated and guide user to finish the certification

7. Output of  "gpg --gen-key" for reference

    gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc.

    This is free software: you are free to change and redistribute it.

    There is NO WARRANTY, to the extent permitted by law.

    Note: Use "gpg --full-generate-key" for a full featured key generation dialog.

    GnuPG needs to construct a user ID to identify your key.

    Real name: pipilu

    Email address: pipilu@hotmail.com

    You selected this USER-ID:

        "pipilu<pipilu@hotmail.com>"

    Change (N)ame, (E)mail, or (O)kay/(Q)uit? O

    We need to generate a lot of random bytes. It is a good idea to perform

    some other action (type on the keyboard, move the mouse, utilize the

    disks) during the prime generation; this gives the random number

    generator a better chance to gain enough entropy.

    We need to generate a lot of random bytes. It is a good idea to perform

    some other action (type on the keyboard, move the mouse, utilize the

    disks) during the prime generation; this gives the random number

    generator a better chance to gain enough entropy.

    gpg: key XXXXXXXXXXXX marked as ultimately trusted

    gpg: directory '/home/pipilu/.gnupg/openpgp-revocs.d' created

    gpg: revocation certificate stored as '/home/pipilu/.gnupg/openpgp-            revocs.d/76SCDEFEFGGEEFO0X78998137.rev'

    public and secret key created and signed.

    pub   rsa3072 2025-03-21 [SC] [expires: 2027-03-21]

      76SCDEFEFGGEEFO0X78998137

    uid                      pipilu<pipilu@hotmail.com>

    sub   rsa3072 2025-03-21 [E] [expires: 2027-03-21]

Reference Docs:

1. https://github.com/git-ecosystem/git-credential-manager/blob/main/README.md
2. https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/credstores.md
3. https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md#net-tool

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值