Check in code to tfs from external zip-file - visual-studio

I've been working on a bug lately on my mac computer. This is what I did:
I downloaded the zip-file from tfs to my mac and fixed the bug. I ziped the file and got it over to my windows comp. What I wanna do now is to check in code from that zip file to the branch where I got the code from.
Im connected to the team on tfs but I cant see any changes in the team explorer while having the project in VS 17 and connected to tfs through team explorer at the same time. I appreciate any help I can get or any directions at all! Thanks in advance!

Generally you can not simply downlaod the zip files from web portal.
Get(downlaod) the zip file in workspace which mapped to the
specific branch.
Eextract the files --> change codes --> zip the files again. (You
can do this in anywhere with windows explorer)
The most important thing is that you need to copy the new zipped file
(with the same name) to the workspace to replace the old one, and you can see the
pending changes, then check in the changes.
I tested that on my side and that works as expected.
UPDATE:
If you can not see the zip file in Source Control Explorer, then that means the zip file is not in source control. You need to add the file to source control.
Copy the zip file to workspace folder
Right-click in Source Control Explorer --> Add items to
Folder --> Select the zip file in Add to Source Control dialog,
then Next --> Finish

Related

How do I change the name of a file?

In visual studio 2015 I changed the name of a file in my project (from test.ps1 to test.psm1). I saved my project. I committed the file (this is a git bitbucket repo) and pushed.
The filename in VS changed, but it did not change in the file system. If I view it in explorer its still called test.ps1. If I view it in bitbucket its called "test.psm1"!
What the heck happened and how do I do this right?
Edit:
OK so now I have a problem where modifying a file in VS is not reflected in the file system. Maybe I'm just misunderstanding how VS works?
I create a file in my project, or edit an exiting file and save and I don't see any changes on the file system.
If I commit and push I see those changes in my commits in bitbucket, why don't I see them on the file system?
Whats crazy is if I create a new file in VS I don't see it in file explorer, BUT if I open a PS console and do "Get-Item fullPathOfFileICantSeeInExplorer.ps1" it finds it! What the hell is happening?
Copy the problem file to another file system location and rename it.
Delete the problem file using Visual Studio from your project.
Add the renamed file to your file system location of where it was in your project.
Add existing file using Visual Studio and select the renamed file.
Finally, Commit.

Team Explorer does not detect all adds to the local workspace

I'm using Visual Studio Professional 2015
Version 14.0.24720.00 Update 1 with TFS 2013 (30723.00).
Let's say my local TFS workspace is d:\workspace
Some of my existing projects which are not in source control are lying under d:\projects and I want to add them to TFS.
When I copy Solution_A from d:\projects to d:\workspace\solution_a_team\Main, where solution_a_team is the team project folder with a branch named Main, Team Explorer says Detected: x add(s) - where I'm assuming x is the number of files transferred.
What's confusing is that the number x is not consistent. Sometimes all files are detected sometimes only small percentage of files. What am I doing wrong, or what's the best way to check these folders into TFS?
First, please check whether there are some files adding in the excluded changes. There are included changes and excluded changes in the pending changes page.
Also, it's not recommend to just copy files or projects to the workspace folder. It's not the right way to add files in source control.
If you want to add a solution in source control, just open the solution in solution explorer and right click the solution ,in the explorer select "Add solution to source control" and choose the location you want add to. If the solution have added in the source control, there will be a lock icon in front of it.
If you want to manually add files in version control, the simplest way you can Drag the folders or files from Windows Explorer into the folder in Source Control Explorer . More details please refer the link from MSDN: Add files to the server
Moreover, you can also achieve this through TF command, or check in files through windows file explorer directly by TFS Power Tools.

"Files already in version control are hidden" but I cannot find them them in TFS?

Steps I made leading up to this problem:
I created a project in Visual Studio Online (TFS) and checked in the entire contents (about 200mb) of a folder called classic.
I created another project and checked in the entire contents of a folder called dlls.
I decided that it would make more sense if these two folders were apart of the same project, so I deleted both of the ones I created in steps 1 and 2.
I created a new project and mapped it to a folder on my computer that contains both the classic and dlls folders.
In Visual Studio 2013, I go into "Source Control Explorer", right click and select "add existing item", and try to add both folders.
In this prompt, none of the files that I need to add are shown! The prompt gives me a message at the top that says "Files already in version control are hidden". If I click through each folder they are blank except for other folders. I verified that the files are still there on my local machine.
The problem is, I deleted those 2 projects in TFS that had the files. Do those projects still exists somewhere? How do I completely get rid of them? Where can I find those files at if they are "already in version control"?
This may be happening because even though you deleted the files from the server, you local workspace still thinks they are available on the server. The easiest way to recover is if you can delete your workspace and recreate it. Be careful not to delete your local files without creating a backup.

Rename project folder in Visual studio and Team foundation server

My Visual Studio 2013 solution has a project "Test". I can rename it in solution explorer, but I also want to rename the project folder in disk and also reflect the change in Source Control(TFS). How can I easily do this?
Thank you
#CodeCaster, Thank you. Based on your advice, I have done some quick experiment, and worked it out. First step is rename the folder name in TFS; the new folder will appear in local workspace and all contents of the folder moved to this new folder. The old folder stays there with rest content which not belong to source control. You can delete it manually.
Or
Using TFS Power Tools to rename from Explorer.
I followed those steps to preserve the version history of the files inside of TFS:
Rename/move project file (.csproj) in source control explorer in VS (alternatively, this also works from within VS Solution explorer, simply select "rename")
Rename/move project folder in source control explorer in VS
now the project should be unavailable in VS, solution also gets closed
remove project from VS
add project (new path) to VS
fix project references in other projects
adjust namespaces if desired
adjust assembly name and default namespace in project settings
Don't know of an easier way. Was searching for this myself, and this should be the way to go.
I think you can rename it from the TFS Database.
Try going into tbl_Project of the Tfs_DefaultCollection Database, which you can find on the SQL Server Instance used by tfs. You can know which one is that by going into the TFS Console, click on Application Tier, then find the details of the Server under the Data Tier Summary. Run an update query against the project you want to rename.. I haven't tested this but just assuming it should work (some educated guess)..
I am using TFS 2015 Express and rename project is grayed out.
You can still rename the project using the TFS Site for the project.
Here is a link that shows how to do it.
https://www.visualstudio.com/en-us/docs/setup-admin/rename-team-project
I was facing a similar issue while trying to rename a folder in Visual Studio 2015.This is what I tried.
Right click on the project file
Open with Notepad
This will generate your current solution file
Change the occurences of your prev file name. (Find and Replace with the desired name)
Save it and close
Change solution explorer name and rename the folder to your desired name.
This should work.

Retrieving file from source control?

Hi guys when I open my solution from source control(TFS 2013) in the morning some folders in a class library project does not load but they are in the windows explorer so I had to "Include in project" the folder after showing all files in the solution explorer but there are no contents even though i "Get Lastest(Recursive)" but I checked the web(Tfs) in the code -> explorer there are files shown in the tree view. Is there a problem with tfs? or visual studio? or both? what can I do to resolve this?
Looks like you have files checked-in TFS but your project file in TFS doesn't have those files included. Also, when you get latest from TFS looks like you override the local changes.
I have three(ish) suggestions:
You have the directory with the included files mapped to a different place on your local drive. You can check this my looking at your workspace mappings (File -> Source Control -> Advanced -> Workspaces). If you have more than one workspace then make sure you're using the right one.
You can force TFS to download files that it believes it has already downloaded. Instead of GetLatest, choose Get Specific version (this may be on the same menu or under Advanced - can't remember for 2010). Check Overwright writeable and all files and select Get.
Install TFS Power tools and try adding the files that way (i.e. through windows explorer)
This isn't really a suggestion, as I don't believe it will work, but if the above don't, try it. As above, select get Specific version, but instead of Latest version, select Changeset and choose changeset 1. THIS WILL DELETE ALL FILES IN YOUR WORKSPACE. The do a get latest as normal.
HTH

Resources