Communication with TFS from client project - visual-studio

I have client project (angular) that hosted on tfs.
In Solution explorer in Visual Studio window I don't see any indication showing connection to tfs.
Is there a way to see an indication of the tfs in such a project?

For different source control, there is different indication.
If you are using TFVC. In the front of your project, there should be a lock icon which indicate the project file already in TFS Server.
If you are using Git. You could find this info in the status bar.
2 shows the number of unpublished commits in your local branch. Selecting this opens the Synchronization view in Team Explorer.
3 shows the number of uncommitted file changes. Selecting this opens the Changes view in Team Explorer.
FabrikamFiberWeb shows the current Git repo. Selecting this opens the Connect view in Team Explorer.
master shows your current Git branch. Selecting this displays a branch picker to quickly switch between Git branches or create new
branches.
Note:
If you don't see any icons such as 2 or 3, ensure that you have a project open that is part of a Git repo. If your project is brand new or not yet added to a repo, you can add it to one by selecting on the status bar, or by right-clicking your solution in Solution Explorer and choosing Add Solution to Source Control.
More details about how to use Visual Studio and Azure DevOps Git Repo please refer this official tutorial--Share your code with Visual Studio 2017 and Azure Repos Git.

The solution is to add the project folder to a new project template: Blank Azure Node.js Web Application.

Related

How to change and create multiple repositories in Visual Studio 2022 - 17.04

I have a solution called Finanzdurchblick_Solution
Within that solution, I have a main project Finanzdurchblick and two referenced projects Category_Helper_Project, CSV_Helper_Project and an additional secondary, local project String_Helper_Project
When I go to the git Changes page, I can see that the String_Helper_Project is selected.
I could stage changes I make in String_Helper_Project but there are no unstaged changes. Changes in my Main Project Finanzdurchblick are not included:
When I open the Git dropdown at the top of visual studio, I can see the local repositories for my referenced projects but my main poject Finanzdurchblick is not visible there:
How can I add a local repository for my main project? And how do I switch to it in the Git Changes window? I am used to see a button "Add repository" when there is no repository yet. From there I could choose to push to a remote location or keep it locally.
I have also checked out the Create Git Repository page but could not find how to create one there. Interestingly, it references my String_Helper_Project in the path there:
I already checked the solution folders and could not find any .git folders.
Edit: in my Solution explorer, I found that String_Helper_Project is "checked" in, when I hover the Mouse over the small blue Lock beneath it.
Enable Repo Switching in Git Changes and other areas:
Visual studio 2022 adds the support for multiple git repositories in one solution.
This is still a preview feature. To enable the feature:
Press Control + Q to open the search function or use the searchbar at the top of visual studio.
type features and choose the search result which states Environment > Preview Features
Enable Enable Multi Repo Support (requires Solution to restart)
Restart your visual Studio
Now you should be able to switch between your Repositories In the Git Explorer and Git Branch Explorer:
Add new Repositories
In order to Add new Repositories, go through the File Menu:
File > New > Repository
There you will find the Option to add a new (local) Repostitory.
Make sure to choose the proper path to your project.
This will also generate the gitignore files which are not included when creating the repo with an external application.

TFS Project Deleted, how to upload code to new project

Somehow on my team's TFS server, one of our projects got deleted. The code is on my local machine though so I'm trying to get it reuploaded, but I'm running into issues getting it back on the server. I've recreated the project and given it the same name and Visual Studio seems to recognize that the new project I've created is connected to the Project I'm trying to upload as a result. The problem is that when I try to check in the version I have to the new project it throws a pile of errors because the files "does not exist at the specified version or you do not have permission to access it". Is there some way to force the upload so that the files are all on the server again?
First remove .* folder from your current working project.
Then go to Visual Studio
Open Team Explorer
Click On Manage Connection
Add your account If not added
Enter your tfs url
Select your TFS folder where you want to checked in your code.
Try to checked in your code.
Even though you have deleted the project on server side, all changes in TFS are non-destructive.
You could check this, just navigate to the Source Control –> Visual Studio Team Foundation Server section.
In that section is a check box that says "Show deleted items in the Source Control Explorer"
If you have recreated the project and given it the same name and want check in local code to TFS. This may cause some trouble.
Suggest you to permanently destroy the project in TFS using Destroy Command (Team Foundation Version Control)
tf destroy [/keephistory] <itemspec1>[;<versionspec>][<itemspec2>...<itemspecN>]
[/stopat:<versionspec>] [/preview] [/startcleanup] [/noprompt] [/silent] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]]
After destroy the old project, then create a new project with the same name, add your local code to this project, finally check in pending changes.

Visual Studio Team Services opens an empty/unupdated solution?

We're trying to work together on our project, using VS Team Services. The problem is when we're opening the project from within its' VSTS website - what we see is the project empty and not updated with any recent changes.
The project's repo is on my PC, so I'm able to open it not from its' website.
'Sync' was being used.
edit: It seems that whenever I commit changes the VSTS saves our project to its' VS-site. why is that necessary?
You should add the source files to source control first. Then you could use Push with Git (or Check-in for TFVC) effectively. In your case, you should use the "Add to Source Control" option on the Solution itself to add all the appropriate files to source control.
Note that VSTS host two different source control technologies: Git and TFVC.
I would advice you to understand which technology you are currently using by reading this detailed article, then you will be able to add the source and work with team on the same repository.

How to convert a deleted regular directory into a branch in TFS?

I'm in the middle of migrating a repository from TFS to Git, and I'm using git-tfs.
I've already converted my Trunk branch using 'git tfs clone ...' successfully. When trying to 'git tfs branch --init' a related branch it fails with the error message: 'error: TFS branches $/foo/myrelatedbranch not found!'
This seem to be caused by the $/foo/myrelatedbranch no being a proper tfs branch. The 'branch' documentation (https://github.com/git-tfs/git-tfs/blob/master/doc/commands/branch.md) seem to be pretty clear on the related branch having to be a PROPER branch (https://github.com/git-tfs/git-tfs/blob/master/doc/commands/branch.md#merge-changesets-and-branches).
The branch $/foo/myrelatedbranch has been deleted a while back, so I'm not able to see the option 'Branching and Merging -> Convert to Branch' in the Source Control Explorer.
Is there any way of making this deleted directory a proper branch in TFS?
Using Visual Studio 2015 and TFS 2015
You can configure the Source Control Explorer to show deleted items:
From the menu bar choose Tools, Options.
On the Options dialog box, navigate to Source Control, Visual Studio Team Foundation Server.
Select Show deleted items in the Source Control Explorer, and then choose OK.
If you now open the Source Control Explorer, you can view the deleted folder and convert the folder to a branch.
You can also rollback the changeset that deleted the folder. The rollback will create a new changeset where the changes are negated (so in this case, where the folder is added).
If the problem still exists, you could just take a snapshot of the latest version and migrate that to Git.

Ankhsvn integration with Visual Studio 2010 - Adding Solution - Working Folders Issue

Newb to Ankhsvn and Ubersvn integration.
I have existing web projects built in Visual Studio 2010 and am attempting to add them into a newly created repositories. The issue I'm having is trying to configure the working local directory. I've got my projects contained in various folders on my machine but it seems Ankhsvn will not let you change the "Local Folder" (which I'm assuming is the working folder) on your machine, it only gives selected options in a dropdown. I know Visual Studio generates it's own solution file in the standard directories (my docs../vis stud../projects/...) but that is not my working directory which it seems Ankhsvn is fixed in.
I don't want to have to move my projects around (and probably don't have enough space on my c: drive anyway). Does someone have any insight on how I can configure the local folders ankhsvn and Ubersvn can work out of?
Using Windows 7 64bit if that has any bearing as well. Our svn repository is hosted externally.
UPDATE
Well I haven't heard any feedback yet on this so I basically went ahead and used the following methodology to get my files into the repository:
1) Used TortoiseSVN to add the files to the svn repository (with TortoiseSVN installed, right click on the folder you want to add, TortoiseSVN -> Import and basically add in the repository URL ad go about adding in folders and files as desired.
2) next step was to then open Visual Studio 2010 and open the given web project folder and then go File -> Subversion -> Open project from subversion. NOTE: make sure when you open that you select the correct folder to import to. It should be one level above the given folder you selected.
3) after the import, all my files appeared as in conflict. I basically just commited the files and the issue went away.
So I now have my project hooked into svn and working through Ankhsvn but has to use TortoiseSVN to get it done...hmmm
To administer the repository in uberSVN you need to make it aware of the repository. The easiest way to do this is to create the repository within the uberSVN admin page, but you've already done that bit, so we need to make uberSVN aware of it.
To do this:
Create a Dump file based on your manually created repository
Login to uberSVN as an System Admin or Repository Admin
Click on Repositories
Click on Add
Enter a Repository Name (which will enter a Location automatically)
Click Next
Click Import From Uploaded Dump File or Import From Dump File Located On The Server
Select the Dump file in question
Click Done
Your repo will now be brought underneath uberSVN, loaded into a newly created Repo sat in the /uberSVN/repositories storage location.
From there you just continue as normal with your preferred subversion client.
Know this QA is old but thought worth updating.
Got a solid, reproducable method for adding projects into remote UberSVN repository from Visual Studio 2010...trial and repeat seems to work consistantly on my side. Here goes
Go to remote UberSVN server, Login
Create Repository
"Your Repository Name"
Added users to repository
Created Visual Studio project (File -> New Project) in similar ubersvn structure…in this case
In windows explorer, created folders D:\\\trunk\
In Visual Studio, create new project, uncheck “Create directory for solution” and I set the “Name” to
"Your Project Name"
In the first solution and subversion create phase, I checked off “Add to Subversion”
Created project and the subversion repository selection popup came up.
typed in the new repository url
http://"your UberSVN Repository URL"/"Your Repository Name"/
Below the Repository URL, I selected the repository “Database” image and then I clicked “Create Folder”
NOTE: When I did again, it seemed that there was already a “trunk”, ”branches” and “tags” folders generated under the repository database -> I clicked on the trunk folder).
If the folders from above notes do not exist, I typed in “trunk” as new folder and then the proper Project url appeared in the “Project will be created in:” section at the bottom of the popup (
http://"your UberSVN Repository URL"/"Your Repository
Name"/trunk/"Your Project Name"/
)
Clicked OK
Started copying files from existing website/project to new project
Once all files are in and no more errors exist, start to do initial commits
Visual Studio 2010 NOTES:
May have to regenerate designer files from older visual studio 2008 projects. Right click on the web form page you want to convert to “Web Application” and it will autogenerate the designer file for the given webform (web page)
Will have to add in references from the bin folder for any dlls needed in project
If bringing over classes from another project (i.e. in App_Code folder), need to right click on each (or select multiple) and go to properties -> Build Action and change from “Content” to “Compile”

Resources