Sourcetree Windows 404 on Create Pull Request on the Web
Asked by Steve Gale:

When committing any work to any repo I stage my changes, do not check "push changes immediately to origin/branch", select "Create Pull Request", type my comments, then click 'Commit'. Every time it 404's and pushes my commit to the remote. What gives?

![404.PNG](/t5/image/serverpage/image-id/37994i73E0450B19BB48FF/image-size/large?v=v2&px=999 "404.PNG")

Things I've done: refreshed OAuth token, deleted and re-cloned repos, restarted


Answers:
author: Steve Gale
body: Any word on this?

comments: author: Mike Corsaro
body: [Could you try 3.0.9 and see if that fixes it](https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-3.0.9.exe)? Thanks!


author: Steve Gale
body: Auth fail, even though my OAuth token was valid. I tried refreshing the token and trying again - same result.![new-sourcetree.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/38617i5B0463746368D4DF/image-size/large?v=v2&px=999 "new-sourcetree.PNG")


author: Mike Corsaro
body: This is probably an issue with the git-credential-manager. [Try downloading v1.18.3 here which should fix it.](https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/1.18.3)


author: Steve Gale
body: That fixed the new auth error. I'm still getting a 404 with automatic commit when I create a PR and do not check commit changes. Still two /'s after bitbucket.org in the URL.

![sourcetree-is-a-POS.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/38618iF609C922A0ACCF91/image-size/large?v=v2&px=999 "sourcetree-is-a-POS.PNG")


author: Mike Corsaro
body: 1. Open the repository
2. Click "Settings" in the main toolbar with the gear icon
3. Double-click/edit the "origin" item
4. Check the "URL / Path" and post that here
5. Optional: change the "Remote Account" to use the Bitbucket account you added previously.


author: Steve Gale
body: https://steveg-iotashome@bitbucket.org/iotashomedev/ec2-deployment.git  

![remote.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/38624iFD0CF5E1ADCD1EC1/image-size/large?v=v2&px=999 "remote.PNG")


author: Mike Corsaro
body: Okay, so there's nothing wrong with the URL. Could you open the file "you repository/.git/sourcetreeconfig.json" and check the value "BaseUrl" under "RemoteProjectLinks" and ensure there isn't an '/' at the end?


author: Steve Gale
body: Yes, all of my repos have "BaseUrl": "<https://bitbucket.org/>" in their sourcetreeconfig.json files.

![config.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/38713i2669CD1F424B5F6D/image-size/large?v=v2&px=999 "config.PNG")

So I removed the / after .org, saved the file, opened sourcetree, made some changes to a file in the repo, staged changes, selected create PR, and it brought me to the PR creation page over HTTPS, but my changes were already committed to the repo (I did NOT check push changes to origin). So we're halfway there.


author: Steve Gale
body: Any more ideas or should I run away from this tire fire?


author: Mike Corsaro
body: Are you sure you didn't push to the repository? We haven't seen any other users seeing a push happen when a the PR link was opened. Did you check the commit log in Bitbucket to see when that commit was actually pushed?


author: Steve Gale
body: 100% sure.

The PR link opened and allowed me to type in comments, but wouldn't let me commit because there were no changes - they were committed a few seconds earlier.


author: Mike Corsaro
body: Ah okay. Just a FYI:

![pr.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/38997iBE493CC30B346835/image-dimensions/561x143?v=v2 "pr.PNG")


author: Steve Gale
body: Yep, my client has the same message.

So maybe I'm missing something here. I just went through the same process of staging a file, writing a commit message, and creating a pull request through the GUI.

![PR-test.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/39004i0325E02727676979/image-size/large?v=v2&px=999 "PR-test.PNG")So what is the point of the "Push changes immediately" box if it is ignored and always pushed? Also, how am I supposed to make a pull request if there are no changes?  
![PR-test2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/39005iAA7665F76AEBB441/image-size/large?v=v2&px=999 "PR-test2.PNG")Or is this behavior due to the fact that I'm working on/updating master and not merging a remote branch INTO master?


author: Mike Corsaro
body: I see -- I thought you were using the context menu pull-request feature (right click on the branch in the sidebar).

The "Push changes immediately" box exists so you can push automatically after commiting (if you had "Create Pull Request" unchecked).

Working on master and merging into master won't do anything because they're the same branch.


author: Steve Gale
body: Okay Mike, I'm on the same page now - thank you for your help!

Is there an open bug report for this?

The app continuously rewrites the trailing slash to the "BaseUrl" string value "<https://bitbucket.org/>" inside the sourcetreeconfig.json file which forces me to check/edit the file before I want to create a PR in each of the repos I work in.


author: Mike Corsaro
body: Yeah -- the fix was back-ported and will be fixed in the next release (3.0.11) which *should*be released sometime tomorrow if everything works out ?


author: Mike Corsaro
body: Hello! Could you check which version you're on (Help \> About)? There was a bug where we accidentally added an extra '\\' at the end of 'bitbucket.org' when making a PR that was recently fixed. Thanks!

comments: author: Steve Gale
body: I'm running version 3.0.8.2279


Tags: windows