Pull request suggestion(print-branch-links-hook) still have the old URL after changing the Bitbucket server URL
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
After changing the Bitbucket URL and updating the base URL, pull request suggestions() in the command prompt still have the old URL.
When the change is pushed to server, the following appears in the the command prompt where in URL still points old one.
remote:
remote: Create pull request for foo-test:
remote: https://<MY OLD URL>/projects/myproj/repos/myrepo/compare/commits?sourceBranch=refs/heads/foo-test\\ remote:
Cause
git remote is still pointing to old url
Resolution
- Do a fresh clone using new URL
set the git remote to new URL
git remote set-url origin http://admin@<new url>/scm/<project>/<repo>.git