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
git config --global --add core.askpass
The first command disables Credential Manager for Git, the second one turns it off for openSSH.
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.
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.
That's what I get. Even after I performed the action "pull" (a few days ago when this problem occurred and I had to "make a compromise" to finish my school work) I still couldn't get the files to be pushed into the "master" branch on Bitbucket. It was sort of untouchable, so to speak. And the only way to not get the invalid username/password error for me is to include username:password in the link to the repository on Bitbucket which isn't very private since I have to take screenshots for my school work. I was trying to sort things out in Sourcetree in Authentication bar in Tools>Options, but these credentials, or whatever you want to call them, confuse me, the whole process does.
All want to know (with simple and plain instructions, not like those tutorials where they just go on blabbing about this and that and so on) is how I can create a repository on Bitbucket, create a remote repository in Sourcetree so I can push to the repository on Bitbucket (to any branch I desire) and how to set the credentials right so that I don't have to deal with any errors.
Thank you in advance.
I think I know what got you into this issue in the first place, you created a new repository locally instead of cloning the remote repository. This would also explain why you could not merge your changes into master in Bitbucket.
Okay, so here is the simple guide you are looking for to create a repository and clone it:
So try this, go to c:\users\<your user ID>AppData\local\atlassian\sourcetree and remove the passwd file. Then go to Credential Manager (under control panel) and remove any references to Bitbucket. If you now do another clone you should be asked to enter your Bitbucket password.
You could also try and setup a SSH key, that way you do not have to deal with usernames and passwords for Bitbucket. You can find the instructions on how to do that here: https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
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