remove git repository binding from visual studio 2015 - tfs

Initially my project was mapped to a git repository.I Want to remove git mapping and bind it to tfs (vs2015).I removed .git folder and its related files from the solution(my local drive) and open the solution in vs2015 and change the source control option to tfs. when adding solution to the source control I'm getting the following error
"the current solution has projects that are located outside the solution folder.These projects will not be source controlled in git repository.To add all the projects to a single git repository please consider all projects under a single folder"
If I click on OK on this error dialog, it automatically adding git folder to the solution.
I removed source controler provider for GIT from the registry via regedit. Now when i try to add solution to the tfs I am getting the error "The project or solution you opened requires a source control plug-in that is unavailable at this time.
I've tried different ways nothing worked.

Create a new team project on the TFS web portal.
Start Visual Studio session. Select Tools->Options->Plug-in Selection and switch current source control plug-in to "Visual Studio Team Foundation Server".
From Visual Studio connect to the TFS and select the collection and the newly created team project. A local folder will be created for your new team project.
Copy all your sources in the local folder of the new team project.
Open the solution in the current session of Visual Studio. Add the solution node to the source control. Check in and your done.

You cannot change or mix TFVC with Git in the same project. You need to create a TFVC project, then check in the sources to the new project.
If you don't need to keep the source history, just pull down and check into the new version control as Mircea mentioned above.
If you want to keep the history, just try to migrate all history of main branch from local repo to a new TFVC team project with following steps:
Create an empty TFVC team project
Go to your local Repo folder, and use git-tf checkin --deep command
to checkin the local repo to a TFVC team project. By default, the
checkin command will create a single TFS changeset for the aggregate
of all changes made on the current branch in Git since the last
checkin to TFS. When used with the --deep option, a TFS changeset
will be created for each Git commit on the current branch since the
last checkin to TFS.

Related

Migrate TFS to TFS including changesets

I need to download entire project from TFS including changesets and need to add to another TFS server with all changeset details.
Is this possible in TFS?
Please help.
I made this done using git-tf and Powershell
I installed git-tf using the following link
https://chriskirby.net/blog/migrate-an-existing-project-from-tfs-to-github-with-changeset-history-intact
I cloned my existing TFS repo to Git,by using
git-tf clone https://myaccount.visualstudio.com/DefaultCollection
$/MyBigProject/MyMainBranch --deep
Inside the GIt folder there is a subfolder named .git,inside we can find a file git-tf.
Inside the file rename changeset to TFS.
To checkin GIT to TFS, configure the TFS folder where you need to copy the GIT. Folder must be empty.
change directorty to the GIT folder in powershell.
git-tf configure http://xxxxxxx:8080/tfs/DefaultCollection/
$/xxxxx/xxxx --force
git-tf checkin --deep --autosquash
Note:
Commit time will be the current time and for all changesets and author will be the person doing the operation.
To keep the author you can try
git-tf checkin --deep --autosquash --keep-author

How to clone a VSTS project/workspace locally?

We have a project/workspace setup in Visual Studio Team Services online. I would like to get a local backup of the workspace and project with all of its artifacts (attachments, Wiki notes and attachments, etc.).
Would a local version of TFS pointed to VSTS online clone the epics, features and stories locally? This is what I really need.
What is the process to accomplish this?
You can not clone the whole contents of a team project, but clone the source code from version control system (Git or TFVC) is possible.
If you are using Git as VCS, you can use below command to clone the VSTS git repo:
git clone <repo URL>
And you can also refer the document to clone a VSTS git repo via VS.
If you are using TFVC as VCS, you can map TFVC repo locally in VS. Detail steps you can refer Develop and share your code in TFVC using Visual Studio.
Seems you also want to migrate WIT from TFS to VSTS. You can refer these related posts: Migrate Workitems from local TFS into VSTS and Migrating Work Items from TFS 2017 to VSTS.
Besides, you can also refer the document Migrate data from TFS to VSTS.

How to enable git on existing TFS project?

Environment: Visual Studio 2017, TFS project set at visual studio online.
I am working on a community project. The source code is checked into TFS project using the free account provided by visual studio online.
I now need to enable git on this project such that others can use from other projects.
On TFS online, I see a way to create a new GIT-based project but I don't see any option to enable GIT on an existing TFS project. I remember to have used this option long time ago. Wondering where I can find this switch. Or, is there any easy way to migrate existing code to GIT. Regards.
You can use Import repository to import the Git repository from TFVC.
From the repo drop-down, select Import repository.
Select TFVC from the Source type dropdown
Type the path to the repository / branch / folder that you want to
import to the Git repository. For example,
$/0522TFVCScrum/BuildProcessTemplates
If you want to migrate history from the TFVC repository, click
Migrate history and select the number of days. You can migrate up to
180 days of history starting from the most recent changeset. A link
to the TFVC repository is added in the commit message of the 1st
changeset that is migrated to Git. This makes it easy to find older
history when needed.
Give a name to the new Git repository and click Import. Depending on
the size of the import, your Git repository would be ready in a few
minutes.
Refer to this article for details: Import repositories from TFVC to Git
Hover over the Code tab, click "Manage Repositories", then click the "New Repository" button.

How do I enable Git for Visual Studio/Team Server 2013

We have a Team Project we created in 2013. The web site of the project allows Git Repos to be created, but in Visual Studio 2017 the Git repos we created are always Offline and exhibiting other odd behaviors (loading TFVC's interface in Visual Studio even when connecting to a Git repo within it for example). I used Fiddler to check out the traffic and noticed that this particular project is missing the SourceControlGitEnabled = true flag. A project we created a year and a half later DOES include the SourceControlGitEnabled flag and works properly.
Is there a TFS Team Project setting we can alter/enable or do I have to create a new Project with Git as the repo and migrate everything to it?
When you create a new repo in the Team Project in TFS2013, there should be a warning as below:
Note that some versions of Visual Studio will only provide full Team
Explorer integration with a repository that has the same name as the
team project. Users may need to manually clone this new repository to
use it in Visual Studio.
This maybe the limitation of TFS2013 with GIT, either manually clone this new repository to use it in Visual Studio or create a new Project with Git as the repo and migrate everything to it, both should be work.

Using Xcode with TFS 2015 on-premises

Is there any way to check in code from Xcode to TFS 2015 on-premises installation? Even if TFS is just acting as a go between for Xcode and Git? The main thing we'd like to be able to do is for iOS code to be checked in to TFS with changesets recorded, and work items/bugs available.
Any suggestions? We are not looking to move to VS Team Services / VS Online.
you have 2 options.
The best option is to create a new TFS Team Project with Git for source control. Or you can add a Git repo so an existing Team Project. This is a standard Git repo, but hosted in TFS. It works just like any other hosted Git repo. Clone the repo and off you go.
If you cannot use Git inside TFS and you must use TFVC then you can use git-tf. This is effectively a bridge between a local git repo and a centralized TFS TFVC repo. This article should get you started
Both VSTS and TFS 2015 include full support for Git-based source control projects. You can follow MSDN article Share your code in Git using Xcode to push your project to TFS.
After pushing your project to TFS, you'll have full history and work item available:

Resources