Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Clone fails always from sourcetree 3.4.3 on windows from Gitlab EE at site with error 403


I have Windows 10 Enterprise, I'm on a VPN (shouldn't matter).

I installed sourcetree portable version 3.4.3 64bit on it.

I have my ssh keys as generated by the ssh-keygen that comes with Windows 10 Enterprise. I simply ran "ssh-keygen -t ecdsa -C "my comment""

I have the public key from that pasted into my SSH public value in my gitlab account.

git operations with command line git work fine (using PortableGit 2.30.1) with these same keys (located as usual in \Users\<username>\.ssh )

I do have sourcetree set in the General tab to use openssh

When I try to a clone from the Remotes in sourcetree I always get this kind of error

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote https://<site url to gitlab>/project/subproject.git
Error: remote: Git access over HTTP is not allowed
fatal: unable to access 'https://<site url to gitlab>/project/subproject.git/': The requested URL returned error: 403

where I've made the exact URL anonymous just for posting.    What's so odd is that I cloned from the exact same gitlab with the portablegit via command line, then I imported that directory tree into sourcetree as a "local repo" and sourcetree then seems to successfully do pulls and fetches (It says "pull successful") but if I try to use sourcetree directly to clone I get the 403 type error above.  I would have thought that a fetch or pull would exercise the authentication with gitlab in much the same way as a clone.

I am using my ssh key with a passphrase and I typed that into the sourcetree agent prompt that shows when it starts up (BTW that's kind of error prone, sourcetree at startup seems to spawn a command line window to load the agent which sometimes isn't visible (might be under windows) so the user can go off and try to use sourcetree with the agent not loaded with the Passphrase. I'd suggest some kind of popup built into sourcetree so the prompt is more in your face)

1 answer

1 accepted

I found the answer myself, the clone syntax was wrong I had:

https://<host serving gitlab>/project/subproject.git

that results in the 403 so I tried:


ssh://git@<host serving gitlab>/project/subproject.git


and that worked.   I figured that out by looking in a working command line git  .git/config file and stealing the URL format from that.  So I think that means the PAT is not being used, at least not for cloning.  Maybe sourcetree uses the PAT still for getting lists of repos from the server and other stuff in the gui.  It would be helpful to show some sample url formats in the clone popup.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

60,346 views 127 26
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you