I’m working with Azure DevOps Server (TFS 2018, on-prem) and Visual Studio 2022, using Git repositories hosted on TFS.
I’m facing several issues that make Git hard to use reliably in this setup, especially from within Visual Studio.
Azure DevOps Server (TFS 2018, on-prem)
Visual Studio 2022
Git repositories
Windows
When I try to create a Pull Request from Visual Studio:
The Create Pull Request button is visible
Clicking it does nothing (no dialog, no error)
Creating the Pull Request from the TFS Web UI works perfectly
This happens consistently, even after restarting Visual Studio.
After completing a Pull Request and enabling “Delete source branch after merge”:
The branch is correctly deleted in the TFS Web UI
However, the branch still appears under:
remotes/origin/branch-name
in Visual Studio
I tried:
Fetch
Refresh
Restarting Visual Studio
But stale remote branches sometimes remain visible.
In the commit history, the same person appears under different names, for example:
Muhammed Alsaro
Max-TechAi
Even though all commits are pushed by the same TFS user.
It appears Git is using user.name / user.email instead of the TFS identity, which leads to:
Duplicate authors
Messy history
Harder auditing
Currently:
The same user can create a Pull Request
And also approve / complete their own Pull Request
I would like to enforce a workflow where:
Developers can create Pull Requests
But cannot approve or complete their own PR
At least one other reviewer is required
However, it’s not clear which repository or branch permissions / policies should be configured in TFS 2018 to enforce this correctly.
Is the Pull Request button not responding in Visual Studio a known issue with VS 2022 + TFS 2018?
Is there a recommended way to clean/prune deleted remote branches from Visual Studio only (no command line)?
Is there any supported way to align Git commit identity with TFS users?
What is the correct way in TFS 2018 to:
Prevent users from approving their own Pull Requests?
Require at least one reviewer before completion?
From a practical standpoint, is Git fully recommended on TFS 2018, or is TFVC still the more stable option for on-prem environments?
There's a lot to unpack here :). Let's address the elephant in the room, Team Foundation Server 2018 is "old" and is now in Extended Support mode. Visual Studio 2022 is much newer, 2017, 2019, 2020 and 2022 have come out since Team Foundation Server 2018 was released.
While Visual Studio 2022 officially supports Team Foundation Server 2018, there are more than 2 major versions between Team Foundation Server 2018 and the version that shipped with Visual Studio 2022, Azure DevOps Server 2022.
Microsoft documents that most features should work, but that a few of them might be broken:
General support
If a client is two versions older than your server, you can expect general support after you install a compatibility GDR. This support is similar to the high level of support you see when Visual Studio is one release older than Azure DevOps Server. The experience for some non-mainline scenarios might be degraded but not entirely blocked. Non-admins should be able to continue unimpeded in their daily work. Older process templates should remain compatible with the new server.
While I'd expect the Create Pull Request button to work, there are no guaranteed.
The best way forward is to upgrade Azure DevOps Server, a new version has just shipped, they have removed the year from the server version.
And Visual Studio 2022 has recently been superseded by Visual Studio 2026, it's more likely bug fixes will make it into Visual Studio 2026.
If you feel this is sufficiently broken, you can submit a bug on the Developer Community either under Azure DevOps Server or Visual Studio:
Now onto the other issues.
Every time you perform a git fetch (or git pull), git records the remote branches in your local git repo. And while branches are cleaned up on the server, git doesn't automatically clean them up on the client.
You can call git fetch --prune:
-p, --prune
Before fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched only because of the default tag auto-following or due to a --tags option. However, if tags are fetched due to an explicit refspec (either on the command line or in the remote configuration, for example if the remote was cloned with the --mirror option), then they are also subject to pruning. Supplying --prune-tags is a shorthand for providing the tag refspec.
See the PRUNING section below for more details.
You can configure git to automatically prune remote branches through a config change every time you fetch.
git config remote.origin.prune true
Since Visual Studio calls git in the background, it will honor this setting.
You can also configure this setting in the Visual Studio 2022 settings (it will update your global git config on your behalf):
There are a few things that might be going on with regards to the username display in Team Foundation Server.
user.name and user.email settings. Visual Studio 2022 should be picking up these settings too.user.email and user.name setting.I don't remember whether you can set these in the profile page in Team Foundation Server 2018, I'm certain you can in later versions:
There is no built-in way to sync these, most companies enforce these values from Windows Active Directory to begin with and some set the local git config settings from the Windows user sign-in scripts.
To protect branches in Team Foundation Server, you need to setup a branch protection policy.
You can get to branch policy settings with Project Settings > Repository > Policies > Branch Policies > .
Select ... for the branch you want to protect target branch:

You'd enable the Require a minimum number of reviewers policy and then make sure you leave the Requestors can approve their own changes unchecked.
Later versions of Azure DevOps Server have better policy options, especially when multiple users are contributing to the same branch.
Git has been the way to go for new repositories for a long time now. While TFVC is officially still supported, it can ben turned off in recent versions of Azure DevOps.
I've previously provided a long answer comparing TFVC and Git.
Your path forward should be Git. Not TFVC.