authentication - 将远程提交推送到 github 并启用两因素身份验证

标签 authentication github repository commit two-factor-authentication

目前有没有办法将本地提交推送到远程 GitHub启用了双因素身份验证的存储库?
无需每次禁用/启用 2 因素身份验证 我们想要推送本地提交。

谢谢。

最佳答案

如果您更喜欢 HTTPS,您可以创建个人访问 token :https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

You can create a personal access token and use it in place of a password when performing Git operations over HTTPS with Git on the command line or the API.



基本上,您可以在个人资料设置中找到“个人访问 token ”。对于 git 命令行工具的使用,您可能希望让您的新 token 访问所有“repo”权限,也许还有“repo_hook”权限(我不使用钩子(Hook),所以 IDK 如果这是克隆需要访问)。

生成 token 后,将其复制到剪贴板,然后在下次 git 提示您输入凭据时使用它代替您的密码。

关于authentication - 将远程提交推送到 github 并启用两因素身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37988916/

相关文章:

git - 为什么运行 `git pull` 会删除我提交的更改?

android - 使用 Android KeyStore 存储用户身份验证凭据

authentication - 如何在clj-http中设置cookie?

swift - 基本身份验证 swift 4

java - 存储库和服务层之间的区别

git - 有没有我应该在 Mac OS X 上初始化我的 Git 存储库的首选路径?

git - 使用 SourceTree 克隆存储库

java - 在 java web 应用程序中添加用户身份验证

git - 从 Github 中提取所有 Gist ?

git - 如果文件在特定目录下被修改,则运行预提交 Hook