Fix 'fatal: refusing to merge unrelated histories' in Bitbucket - Resolve Git Lock File After System Crash-How to Override pip's Externally Managed Restriction

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.