I can't push from Sourcetree to Bitbucket even though I added a remote repository and I entered the right username and password.
Hi @Vito Kurnik,
Welcome to the Atlassian Community.
Do you get an error message when you try and push? And if so, what is that error message?
That is what I got. Here's what went down:
1. I created a new repository on Bitbucket. The "master" branch also got created in the process and it included the README.md file.
2. I then made a new repository on my computer using Sourcetree. I committed a few files and they were all in the "master" branch.
3. I added a remote repository in Sourcetree which was, of course, the one I created earlier on Bitbucket.
4. I tried to push to Bitbucket the files I just committed to the "master" branch in Sourcetree.
5. After that failed I pulled from Bitbucket (it was only the README.md file).
6. After multiple attempts, I couldn't push the files from Sourcetree to the Bitbucket repository into the "master" branch. But then I made a "new" branch and it worked but I wanted the files from Sourcetree to be in the "master" branch in Bitbucket. I tried to merge the two branches on Bitbucket but I couldn't because they're unrelated.
Apart from the error message screenshot, I'm also adding the screenshots from Sourcetree and Bitbucket.
Hi, @Mikael Sandberg I have included the error message screenshot and some other details in my answer down below.
Okay, so the first error message indicate that your username or password is incorrect, so you should make sure that the password stored in Sourcetree and Windows Credential manager is correct.
I made sure of that but even after that, I wasn't able to push the files which I committed to the "master" branch in Sourcetree to the "master" branch in Bitbucket. I didn't capture that error message though - I hope you might still be able to help me anyway considering my description of what went down.
There are lots of things that can prevent you from pushing to a specific branch, for example branch permissions, hooks, etc. Do another push of master and see what error message you get.
For anyone wondering: you will probably find your answer somewhere in the replies to the one I marked as "accepted".
Hi @Mikael Sandberg
I'm back with an old familiar problem. I'm working on a group project and our Bitbucket repository was created a few weeks ago. I tried to clone it and set the destination path to my Unity project folder, but I couldn't - it said I need to choose or create an empty folder. I've decided to create a new local repository in Sourcetree and add our Bitbucket repository as a remote repository. But, when I tried to push, the old "invalid username or password" error message appeared, even though I deleted the passwd file and removed any credential related to Bitbucket.
I know I could just clone our Bitbucket repository into an empty folder but then I'd had to move all my files from the Unity project folder into that folder and that would be exhausting. Any ideas on how to manage the situation?
Make sure your password is not stored in the Windows Credential Manager too. I would recommend that you use an SSH key instead, that way you do not have to worry about passwords. Your other option is to turn off Windows Credential Manager and see if that helps.
git config --system --unset credential.helper<br>git config --global --add core.askpass<span> </span>""
git config --system --unset credential.helper<br>
git config --global --add core.askpass<span> </span>
""
The first command disables Credential Manager for Git, the second one turns it off for openSSH.
It looks like you're new here. Sign in or register to get started.