I'm writing code in a TFS 2013 Project. I'd like to check it into a different Project on the same server. Can I do this? Thanks
You can not directly check in the code to another project, you need to add the code file to another project first for source control, then check in the code changes.
In visual studio Team Explorer:
Connect To TFS project 1, configure the workspace and map source
code to local folder1. Open the folder1 in windows explorer.
Connect To project 2, configure the workspace and map source code to
local folder2. Open the folder2 in windows explorer.
Copy the code file which you want to check into another project (eg,
project 2 here ) from folder1 to folder2, then the system
will detected the new added files under Pending Changes >
Excluded changes.
Click the Detected link to Promote the new added files.
Check in the files to Project 2
Refer to these articles for more information : Add files to the server
and Check in your work to the team's codebase
UPDATE:
You can link to the WI in the same collection, but cannot link to the WI which in another collection.
That means, if the team projects are in the same collection, then you can link the WI (associate with the changeset) which belongs to another project directly.
Related
Im using VS 2013 (CE).
Windows Server 2012 with a local install of Azure DevOps.
I can connect to the repository via the URL
http://example.local/DefaultCollection
Under defaultCollection i have another few test projects i.e.
/DefaultCollection/A-Project,
/DefaultCollection/B-Project.
For this example i will user C-Project which im trying to add to source control.
All im trying to do is add a project to this source control but i am experiencing issues that i would have thought shouldnt exist:
In VS2013, I add a new solution. I right click the project and select "Add solution to source control". Immediately it selects the project A-Project with the path /DefaultCollection/A-Project/C-Project. I dont want this as it resides inside another project.
From the web portal i create a new project and select Team Foundation Server (not Git as the examples online i have seen all select Git). In VS i create a brand new project and then attempt the same as 1 above but it tells me that i already have a project with this name under source control. I expand A-Project and i see it listed and undo any changes but it still doesnt add as i get some form of error.
Other problems range from the local version not mapped to, existing file exists/under source control to other errors.
What is the correct process to add a project to Azure Devops when using Visual Studio 2013 CE?
The default steps are described here: Set up Team Foundation Version Control on your dev machine.
You have to:
Create a workspace from the target project.
Copy your project into the locally mapped folder.
Add your project to the source control.
As workaround:
Create workspace from the target project: Create and work with workspaces
Copy your project into the locally mapped folder.
Add your project to the source control by: Manually add files to version control
Open the project and fix source control bindings:
Useful document: Add files to the server
In Visual Studio 2017, How do you connect to a TFVC project in TFS and prevent it from creating a local repo? I want to be able to copy files from another project in VS 2017 and check-in but not have all the files from that project local?
In the source control explorer, drill down to the project folder you want to add the files to, right click on the folder (you don't have to have it checked out) and click "Add items to Folder".
You should see an "Add to source control" dialog that is showing files from your local computer. From there, it's not too hard to follow.
When you connect to a TFVC project in TFS you could select to create local workspace or not. But we could not restrict users to create local repo or not.
If you do not want others to pull files from server to local, you need to use permissions to do the restriction.
You could directly copy files from another project to your local workspace, VS will auto detect changes and list in the pending change list. You just need to check in files.
More ways about how to add files to the server, please review this official tutorial.
One of my team's created a new folder under a team project and using it as a separate project in tfs 2015.
Is it possible to move that sub folder project to a new project in the same collection?.
Thanks in advance!.
You can use tf rename command to move the path of a file or folder without losing the source control history.
tf rename "$/PROJECT/Sub folder/*.*" "$/NEW PROJECT/XX/"
Note: The results of this command are not reflected in the Team Foundation version control server until you perform a check-in
operation.
Required Permissions
To use the rename command, you have the Check out permission set to
Allow.
I've accidentally added my solution to wrong Team project on TFS, I've gone to File/Source Control/Advanced/Change source control, I've selected all my projects and unbinded them, went to solution, and after right click I've chosen Add Solution To Source Control, but pop-up appeared saying:
The item 'ProjectName.sln' is already under source control at the selected location.
If you are trying to rebind a project that you have already added to source control
outside Microsoft Visual Studio, you should use the Change Source Control command. If you are
adding this project for the first time, you should either choose a different server folder for the project or move the
existing project to a different server folder.
I've tried to bind project to new Team project, but when I tried to check in, not whole project was checked but only changes added since I've accidentally added it to wrong Team project.
To sum up how can now I add my project to TFS source control ?
You need to unbind it, then manually move the files into a local folder that is mapped to the correct team project. Then try doing the Add Solution to Source Control.
Each team project will be mapped to a different folder in your local workspace. If your files are under the folder for project A (which I assume they are if you've already added it to that team project), then you need to move them to a folder under Project B before trying to bind to Project B.
I'm an experienced SVN user getting used to TFS at a new client site. The main problem I've had adjusting to the new tool is this - how can I get a listing of all files in my working copy that have changed from current/latest server revision, including added or deleted files?
Essentially, I'm looking for the TFS equivalent of an "svn diff". The "TF" command-line tool has a "diff" command which reports changed files but I can't find an option to report deleted or added files; this missing feature has resulted in a couple check-ins which (embarrassingly) broke the build.
Which version of TFS?
TFS2010 has a folder compare command, File > Source Control > Compare... (or in the Source Control Explorer, right-click on the project path you're interested in, and select Compare...).
Set up the Source path to be a folder on the server and the Target path to be a local folder in your workspace (or vice versa). Under View Options, select Show items that exist only in source path, Show items that exist only in target path and Show items that are different and click OK.
Is there any reason you can't use the Source Control Explorer?
If you right click on the folder, project or branch you can click Compare and you will see all files that have been deleted or added.
I usually do the following:
Open your Team Explorer tab in Visual Studio and click on Pending Changes.
There you will see your changed files.