简体   繁体   English

SourceTree GUI 无法推送,终端可以推送

[英]SourceTree GUI can't push, terminal can push

Following problem: When I commit things, I can't push them by clicking on the GUI push button I get this error message:以下问题:当我提交内容时,我无法通过单击 GUI 按钮来推送它们,我收到此错误消息:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master Pushing to ssh://xxxxx@git.mydomain.de/srv/git/MyFolder/MyProject.git git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master 推送到 ssh://xxxxx@git.mydomain.de/srv/git/MyFolder/MyProject.git

fatal: Could not read from remote repository.致命:无法从远程存储库读取。

Please make sure you have the correct access rights and the repository exists.请确保您拥有正确的访问权限并且存储库存在。

When I copy the EXACT same command from this error message and klick on the "Terminal" button and paste it there, it works like expected, without any errors.当我从此错误消息中复制完全相同的命令并单击“终端”按钮并将其粘贴到那里时,它按预期工作,没有任何错误。

What I'm doing wrong?我做错了什么?

I guess SourceTree can not read from the remote repository because it can not authenticate you.我猜 SourceTree 无法从远程存储库读取,因为它无法对您进行身份验证。

Make sure that SourceTree can access your ssh key.确保 SourceTree 可以访问您的 ssh 密钥。 You can usepagent to do that.您可以使用pagent来做到这一点。

By changing " SSH client configuration " to OpenSSH and set your id_dsa , it will be fixed (SSH keys should be created and added to gitlab first).通过将“ SSH 客户端配置”更改为OpenSSH并设置您的id_dsa ,它将被修复(应首先创建 SSH 密钥并将其添加到 gitlab)。


Go to Tools -> Options -> General : in SSH client configuration set the SSH Client to OpenSSH , select your id_dsa for SSH Key .转到Tools -> Options -> General :在SSH 客户端配置中将SSH 客户设置为OpenSSH ,为SSH 密钥选择您的id_dsa

Another solution if you're not using SSH, just regular HTTPS is to create a personal access token via github's profile dropdown menu > settings > Developer Settings > personal access token.如果您不使用 SSH,则另一种解决方案是通过 github 的配置文件下拉菜单 > 设置 > 开发人员设置 > 个人访问令牌创建个人访问令牌。

There you can allow all the permissions you want to use.在那里您可以允许您想要使用的所有权限。 Then in the Sourcetree app, go to where you have your Github account, edit it, choose basic for the Auth Type and paste the personal access token you got from Github then click save.然后在 Sourcetree 应用程序中,转到您拥有 Github 帐户的位置,对其进行编辑,为 Auth Type 选择 basic 并粘贴您从 Github 获得的个人访问令牌,然后单击保存。 Now try your desired git action that didn't work before and it should work now since now you'll be able to be authenticated by Github.现在尝试您想要的以前不起作用的 git 操作,它现在应该可以工作了,因为现在您将能够通过 Github 进行身份验证。

I had the same issue of not being authenticated and needing to create this access token since the error said there was an update with Sourcetree and that I wasn't able to use my Github password like before.我遇到了同样的问题,即未通过身份验证并需要创建此访问令牌,因为错误表明 Sourcetree 有更新,并且我无法像以前一样使用我的 Github 密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM