Rename or move files and folders in TFVC
VSTS | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015 | VS 2013
If you're not using TFVC for version control, use Solution Explorer to move and rename files in your current open Visual Studio solutions or projects.
Move an item in TFVC
You can use Source Control Explorer to move one file or folder at a time. You should not use Source Control Explorer to move folders or files that are referenced by a Visual Studio project or solution. Move these files with Solution Explorer instead and check in the move in a new changeset.
In Source Control Explorer, select the item that you want to move, open its shortcut menu, and choose Move.
In the Move dialog box, either manually type the destination for the item in the To box, or choose Browse to use the Browse for Folder dialog box.
Rename an item in TFVC
In Source Control Explorer, select the file that you want to edit, open its shortcut menu, and choose Rename.
Type the desired name for the item.
Fix the outcome after you rename an item in your operating system
You should avoid renaming items managed by TFVC using your operating system (for example, using Windows File Explorer, or the rename command in the Windows command prompt). When you have used your operating system to rename an item in a local workspace, Visual Studio detects the change as two changes: an add and a delete. You can join the two actions into a rename action.
Git version control users can move and rename files from the command line or Windows Explorer without this concern. The changes will be reflected in Team Explorer.
In Visual Studio, in Team Explorer, choose Home, and then choose Pending Changes.
In the Excluded Changes section, choose the Detected: link.
In the Promote Candidate Changes dialog box, select the delete and add actions, open their shortcut menu, and choose Promote as Rename.
A single rename change now appears in the Included Changes section.
Work from the command prompt
- Rename Command (Team Foundation Version Control) : Rename or move a file.
You must be one of the Contributors for your team project. See Team Foundation Server default groups, permissions, and roles.
- If you are beginning a new task, it's a good practice to download the latest files from the server before you make changes to files in your workspace.
- Avoid renaming an item that has been branched but not yet checked in. If you try to do so, a conflict will occur.
- You can review and manage your work, suspend your work, and ultimately contribute your work to the team's codebase.