Fix Git Detached HEAD State in Visual Studio Code - Fix Git Non-Fast-Forward Push Rejection-Fixing VSCode Terminal Launch Issues on Ubuntu

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