简体   繁体   中英

Git submodules best practice - always use ssh protocol over https?

I work on a lot of projects that use submodules, and some of them are added to their parent repos using a combination of both the https and ssh protocols , as if it's not important which one. SSH protocol has benefits that it uses ssh keys, but requires users set up those keys first .

I'd like to make a team policy: all projects should use GitHub's git user with ssh protocol in submodules. What are the pros/cons of said policy?

Pro:

  • ssh keys can be registered/revoked

Cons:

I prefer activating 2FA on GitHub account , and use only Personal Access Token, which can be revoked as well, but which are used as classic username/password way ( and which can be cached ) with https url .

In both cases, the user need to be added as a collaborator to the GitHub repo .

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