SourceTree - git: fatal: remote error: Repository not found
Solution 1
I figured it out the issue. I already had a a personal github account linked to sourcetree. When i deleted the personal github account and added the work account it worked fine.
- Go to Tools -> Options
- Click on Authentication Tab
- Delete the other github account and add the new one
Solution 2
Had the same issue. The reason in my case was that I authenticated via https on command line but then used sourceTree via oAuth. Setting the Auth type to "Basic" in my Account settings helped.
Solution 3
Simple solution for me was that because the repo was a private repo.
I had to append my username and an at-symbol (@
) before the git URL.
Set your remote to
https://[email protected]/YOUR_COMPANY_NAME/YOUR_REPO_NAME.git
instead of
https://github.com/YOUR_COMPANY_NAME/YOUR_REPO_NAME.git
Then enter your github user password upon eventual request.
Or rather use SSH instead
ssh://[email protected]/YOUR_COMPANY_NAME/YOUR_REPO_NAME.git
as HTTPS is to be deprecated soon.
Solution 4
I have experienced the problem on Windows (8.1 x64) with a more subtle reason. The problem stemmed from the use of git authentication hooks, like the git-credential-winstore (https://gitcredentialstore.codeplex.com/).
In order for it to work i simply removed my network password to github like this:
- Start menu
- Manage Network Passwords
- Removed my password for http://github.com
If you want to entirely remove the git credential store this SO post which may be of help: https://stackoverflow.com/a/18376438
Solution 5
In my case, it was because I was using HTTPS in stead of SSH as the remote repository path in SourceTree (Settings > Remotes).
Didn't work in Sourcetree: https://github.com/companyname/reponame.git
Worked in Sourcetree: [email protected]:companyname/reponame.git
To get the latter from GitHub, click Clone or download
then Use SSH
Alaa Awad
Software Engineer by day. Software Engineer by night.
Updated on August 01, 2022Comments
-
Alaa Awad over 1 year
I just signed up for a github account at work and created a new repository. I ran a few git commands over command line and everything worked fine.
1. git init 2. git add . 3. git commit -m "first commit" 4. git remote add origin https://github.com/username/project.git
Then, when I added the working copy from sourcetree and clicked the Fetch button, i get "error: Repository Not Found". I try push and pull and i get the same error. I've been using sourcetree with my bitbucket and github repositories for a few months now but i've never had this problem. Has anyone had similar issues?