简体   繁体   中英

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:

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

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.

Make sure that SourceTree can access your ssh key. You can usepagent to do that.

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).


Go to Tools -> Options -> General : in SSH client configuration set the SSH Client to OpenSSH , select your id_dsa for SSH Key .

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.

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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