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
Related
we have an local DevOps Server 2019 with our old projects and I am able to clone this projects with git-tfs to local Git repositories. Everything is fine. After that I can push this repositories to our AzureDevOps Git repositories. Everything ok.
Now we have some projects and colleagues who want to use TFVC for these special projects. So my idea was to clone these projects from local TFS to Git and then use git-tfs rcheckin to push it to our AzureDevOps project.
But when I use "git-fts rcheckin --remote azuretfs" I get "error: latest TFS commit should be parent of commits being checked in"
When I use "git-tfs checin --remote azuretfs" all files are uploaded to the AzureDevOps project but without the history.
So can anyone describe what I have to do?
Note: I don't want to use the MigrationTool offered by Microsoft because of to many erros during validation the templates of work items etc. (we dont use it...)
For those who are looking for the same:
With the 'old' git tf tool (https://archive.codeplex.com/?p=gittf) you can migrate old TFVC project to Azure DevOps(TVFC).
If you want to migrate old TFVC projects to AzureDevOps(GIT) you should use git tfs (http://git-tfs.com/)
What you could try without guarantee of success...
Note: As I said, you will be able to migrate the history from one branch only.
Create the folder/project in TFVC where you want to put the source code.
Migrate this folder with git tfs clone (to have a git commit with the git-tfs metadata required to rcheckin)
Add the already migrated history repo (let's call it RepoWithHistory) as a local remote in this new repository (let's call it NewRepo). And git fetch
Clean metadata for only the commit coming from RepoWithHistory with something looking like: git filter-branch -f --msg-filter "sed 's/^git-tfs-id:.*$//g'" -- --all. But be careful to keep the metadata on the commits coming from NewRepo.
Use git replace --graft <sha1_of_first_commit_of_RepoWithHistory> <sha1_of_last_commit_of_NewRepo> to graft the 2 histories (the history must be on top of the one from the new one)
Use git rcheckin --no-merge to migrate the history to TFVC (that will be long...)
I hope it will help.
PS: perhaps you should try to do it on a small subset of commits to be able to verify it will works before doing it in the real TFVC project.
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.
I am trying to migrate Source code from TFS to VSTS. I tried git-tf command to migrate and was able to migrate successfully but i am not able to migrate the history. Can someone guide me on what i am doing wrong. Please note i am not migrating to GITVC but migrating to TFVC in Visual studio from On premise TFS server.
Steps are ...
git-tf clone http://onprimisetfsurl/ $/project project
git-tf clone http://Visualstudiotfvcurl/ $project project1
git pull project1 into project
git-tf checkin --deep
Look at OpsHub https://visualstudiogallery.msdn.microsoft.com/28a90a17-d00c-4660-b7ae-42d58315ccf2 since that is the one that was recommended by the VSTS manager https://blogs.msdn.microsoft.com/bharry/2014/05/14/migrating-on-premises-tfs-to-vs-online/
https://www.visualstudio.com/en-us/articles/adopting-vsts also covers other tools if that doesn't work for you.
Add "--deep" when you perform git-tf clone:
git-tf clone http://onprimisetfsurl/ $/project --deep
Add my steps for your reference:
git-tf clone http://tfsurl $/tfsproject --deep
Create a project "vstsproject" in VSTS.
Delete the "BuildProcessTemplates" folder in the vstsproject from web portal.
Create a new folder for vstsproject on local machine.
Run "git init" to set this folder to a git repository.
Pull the changes in tfsproject into the new created repo.
Run "git log" to make sure the history is correct.
git-tf configure https://vstsurl $/vstsproject --deep
git-tf checkin --deep
I got a problem while using xcode 4.6 to commit source code to the TFS, i'm using git-tf
but i can't commit source to server. I have been cloned folder from server. Please help me.
Once you have cloned your code on TFS to local git repo you are ready to make changes. Once you do them use:
git commit -a -m "commnent"
Now you can check them in your TFS:
git tf checkin
All commits will be checked as one single changeset on TFS.
Once upon a time we had a TFS repository. We wanted to move to Git. At the time we took just the latest working version, copied that to a new git repo and started working on that.
However due to decommissioning of TFS we'd like to clone the TFS repo to Git (with git-tf) and rebase our changes on that.
Is this possible?
Assuming you are just talking about the source code (TFS is also a work item tracker, build server among other things)
the --deep argument will clone all TFS changesets
git tf clone <tfsurl> <teamproject> --deep
update: bear in mind that this doesn't take into account linked work items, branches, tags.
beware: this will take a while for large repositories...
further reading: http://gittf.codeplex.com/wikipage?title=Clone&referringTitle=Home