无法在源代码树

时间:2016-09-07 06:49:53

标签: git gitlab git-flow sourcetree

我正在使用gitflow创建一个新版本,但在最后一步推送到gitlab上的远程时,我收到此错误消息:

fatal: could not read Username for 'https://gitlab.local': Device not configured

不知道为什么,它可能与gitlab上的某些设置有关吗?

1 个答案:

答案 0 :(得分:0)

你可以:

  • 将您的用户名嵌入网址

    git remote set-url origin https://{username}@gitlab.local
    

使用credential helper缓存密码。

  • 或使用ssh。

我喜欢使用以下命令动态配置这些远程网址更改:

git config  url."https://{username}@gitlab.local/".insteadOf https://gitlab.local/
git config  url."ssh://git@gitlab.local/".insteadOf https://gitlab.local/

这样,您就不会触摸原始远程网址,并在使用时对其进行修改。

相关问题