我想通过使用我的gitlab帐户中的私有令牌来克隆gitlab存储库而不提示我的自动化脚本.
有人能为我提供样品吗?
我知道我可以使用用户和密码这样做:
git clone https://" + user + ":" + password + "@" + gitlaburl;
Run Code Online (Sandbox Code Playgroud)
我知道用ssh键是可能的
但是,这两种选择都不够
我需要禁用OS X的凭证帮助程序: git credential-osxkeychain
它在全局配置文件和本地配置文件中都被禁用,实际上它从未启用过.它仍然记住我的github登录详细信息.
我在笔记本电脑上,所以我不希望自动无密码访问我的回购.
我将使用ssh密钥.这是一台新计算机,整个系统设置仍在进行中.
现在我使用了httpsrepo refs,凭证助手一直在努力.
这些是我的conf文件:
git config --edit =>
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remote "origin"]
url = https://github.com/user/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "develop"]
remote = origin
merge = refs/heads/develop
[branch "deploy"]
remote = origin
merge = refs/heads/deploy
Run Code Online (Sandbox Code Playgroud)
git config --global --edit =>
[user]
email = **************** …Run Code Online (Sandbox Code Playgroud)