将Bitbucket远程Java项目克隆至本地IntelliJ 2018 Ultimate时遇远程URL测试失败问题求助
Hey there, let's break down your problems and fix them one by one:
1. Fixing the "Remote URL Test failed : unable to update URL base from redirection" Error
This error usually stems from URL mistakes, network restrictions, or compatibility quirks with older IntelliJ versions. Here are actionable fixes to try:
Double-check your clone URL
Bitbucket uses two valid clone URL formats: HTTPS and SSH. Make sure you're copying the actual clone URL (not the web page URL of your repo). For HTTPS, it should look like:https://your-username@bitbucket.org/your-workspace/your-repo.git
For SSH, it's:git@bitbucket.org:your-workspace/your-repo.git
You can grab this URL directly from your Bitbucket repo page—look for the "Clone" button in the top-right corner.Skip manual remote setup and clone directly
Instead of enabling Git first and adding remotes manually, try this simpler workflow:- Open IntelliJ, go to
File > New > Project from Version Control > Git - Paste your correct Bitbucket clone URL, choose a local save path, and click
Clone
This bypasses the manual remote configuration step causing the error, and IntelliJ will automatically set up theoriginremote for you.
- Open IntelliJ, go to
Test the URL in terminal first
To rule out IntelliJ-specific issues, open your system terminal and run:git clone https://your-bitbucket-clone-url.git
If this works, the problem is likely with IntelliJ's settings. If it fails too, check for:- Network proxies/firewalls blocking access to Bitbucket
- Typos in the workspace/repo name (Bitbucket is case-sensitive!)
Update Git or IntelliJ (if possible)
IntelliJ 2018 is quite outdated, and it might not handle Bitbucket's modern redirects well. Try updating your local Git version to the latest stable release first. If you can, upgrading IntelliJ to a newer version will also help with compatibility.
2. Why You Don't See a .git File in Bitbucket
Don't stress—this is totally normal! The .git folder (which stores all repo metadata) is a hidden directory on the Bitbucket server. GitHub and GitLab also don't display this folder in their web interfaces. Once you clone the repo to your local machine, you'll see the hidden .git folder in your local project directory (you may need to enable "show hidden files" in your file explorer to view it).
Bonus Tip: Two-Factor Authentication (2FA)
If you have 2FA enabled on your Bitbucket account, you can't use your regular password for cloning. Instead, create an App Password from your Bitbucket account settings (under Personal settings > App passwords) and use that when prompted for a password in IntelliJ or terminal.
内容的提问来源于stack exchange,提问作者vs777

