简体   繁体   中英

Can I use SSH and HTTPS both for single git account?

If i use SSH then I have to download git repository using git ssh but if I use HTTPS then https is the way.

Can I download those git repo using both way for a single account?

The account is what the remote hosting service will use to authenticate you and determine if you have the right to access the remote repository you want to clone.

  • for HTTPS, it will be the username/password
  • for SSH, it will be the public key published to your remote account profile setting (while the actual remote user for an SSH session is almost always a technical account like 'git': git@remoteServer:Me/MyRepository )

If the remote hosting service supports both protocols, the same user account can clone using either one of them.


If you are using HTTPS, make sure:

  • to create a PAT (Personal Access Token) that you will use as password
  • to check or set a credential helper (to cache those credentials)

That is:

git config --global credential.helper

I recommend setting it to manager-core , using the Microsoft Git Credential Manager (GCM) (cross-platform).
It is already packaged/set with Git For Windows for instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM