对于长期使用,你可以配置Git的凭证帮助器来存储你的OAuth令牌。这可以避免每次推送或拉取时都需要输入令牌。例如,使用Git Credential Manager(GCM):
git config --global credential.helper manager
这条命令会让 Git 将你的用户名和密码以明文形式保存在磁盘上,路径通常是:
Linux/macOS: ~/.git-credentials
Windows: C:\Users<你的用户名>.git-credentials
对于长期使用,你可以配置Git的凭证帮助器来存储你的OAuth令牌。这可以避免每次推送或拉取时都需要输入令牌。例如,使用Git Credential Manager(GCM):
git config --global credential.helper manager
这条命令会让 Git 将你的用户名和密码以明文形式保存在磁盘上,路径通常是:
Linux/macOS: ~/.git-credentials
Windows: C:\Users<你的用户名>.git-credentials
已有 69 位网友参与,快来吐槽:
发表评论