TFS 2018 Project Folder Permissions - tfs

I am having trouble finding a feature that was in TFS2015.
In TFS2015 i could set folder and file level securty, but i can't find that option in TFS2018. Has this feature moved, or been removed?
TFS2015:
TFS2018:

This isn't due to a difference between versions of TFS, it's due to differences between TFVC and Git.
In the first screenshot (TFS 2015) you are working within a TFVC repository, in the second (TFS 2018) a Git repository.
TFVC and Git have different security models so it's not possible to lock down a specific path in a Git repo like you do in TFVC. With Git repos in TFS you could either:
Apply permissions to a branch
Or, if you want to lock down changes to a specific path in a branch is to switch on branch policies and use the code reviewer policy to require a reviewer to approve changes in a specific path of your code base.

Related

Git-tfs Clone: Option to not create temporary workspace (or specify existing permanent workspace)?

How might I run git tfs clone without permissions to create a temporary workspace--or, alternatively, specify an existing permanent workspace which git tfs should not cleanup afterward?
Running command:
git tfs clone --branches=all http://tfs:8080/tfs/DefaultTFSCollection "$/Project"
Error:
TF14044: User {USER} needs the CreateWorkspace global permission(s).
For what it's worth, our TFS admins create workspaces (same as %COMPUTERNAME%). However, my user does not have permissions to create workspaces.
Have downloaded and identified the source code location which seems to perform the temporary workspace creation.
However, can I just not do so? What benefit does a temporary workspace provide?
Use case: Migrating away from TFS 2012 TFVC, to Git (Azure DevOps). So just want to clone. No future need to write back to TFS TFVC.
Thank you
No, git-tfs doesn't have this option to use an existing workspace because it would have been difficult to check if the existing workspace have been created from the good TFVC path.
And also, if you want to clone with branch support, you need to create multiple workspaces at different places so git-tfs need to handle them itself.
If you are in charge of the migration, your best chance is to ask your tfs administrators to grant you this right at least until you finish your migration.

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:

Is possible to use multiple branch specification in TeamCity using TFS Git features?

In my project we use feature branches with TFS 2013 as source control repository and TeamCity 9.1.6 as CI server. We have plans to upgrade to TFS 2015 soon (... and cannot migrate to GIT)
I know you can use multiple branch specification when you use GIT or Mercurial... and it is pretty useful. In TFS 2013, Microsoft added native support for GIT.
I want to do multiple branch specification using my existing TFS server, in order to have a single commit build that builds every feature branch.
So my questions are:
Is there any TeamCity plugin that allow me to do that? (Easier than my possible GIT-TFS trick)
Given that TFS 2013 has GIT support, can I configure my VCS to make TeamCity build think TFS is a GIT server and use multiple branch specification as explained here?
In theory TeamCity VCS connecting to TFS as a GIT server will think it is a GT server, won't it?
No additional plugin is needed.
You can configure Git connection in TeamCity to Git repository hosted in Team Foundation Server 2013. The type of repository will be "Git" in TeamCity, so all git-related features (such as branches) will be supported.
TFS 2013 provides the option to use either TFVC or Git for your source control repository. When you create a team project, select Git from the version control options:
More information of using Git, please check:
https://www.visualstudio.com/en-us/docs/git/get-started

Integrate crucible with tfs

I use TFS with Jira to managment my team tasks.
I want to integrate a Code Review tool at development process.
When i try to use crucible i reveal that it not support TFS.
I want to know if , there is a good and credible solution for this ,to enable me use crucible with TFS.
additional , if there are another suggests for code reiview tool for VS and JIRA.
Thank!
Some time ago we decided to run Crucible on our project. Our project uses TFS 2012. We use one branch in TFS called 'dev' as a trunk, i.e. branch where developers make commits and where raw code located. Second branch where release code located called 'main'
Our workflow for peer review was:
Make some changes and shelve code
Send email to reviewer
Reviewer doing review in some custom tool and send email with notification that he is done
Commit code into 'dev' branch on TFS
Wait while build-server makes successful build
Commit to 'main' branch where production code resides
Our goal was to improve step 2 and 3. Crucible is great tool, but it doesn't support TFS out of the box, thus we decided to use some TFS bridge. Actually, there are two main options either using tfs->svn or tfs->git. Finally, we decided to use tfs->git bridge, because creating branches in git extremely cheap and it might have been helpful (it did), because we was thinking use branches in git for out shelvesets in TFS. Finally we made our mind to use git.
So far I know only 2 options to convert TFS into git:
git tf - this one works on Linux and recommended by Microsoft
git tfs - this one works only under Windows, but we choose this one, because of large set of commands
We need to convert TFS branch into Git repo and maintain our git repository in fresh state. We don't work with git to push new changes back into TFS, we need git repo only for Crucible.
There are steps we made to achieve the goal:
1. Firstly, we cloned our TFS "dev" branch into "dev" repo. We needed only this one branch, and we haven't any back merges from "main" branch. We have tried to do this with clone command, but without any luck:
git tfs clone http://tfs:8080/tfs/DefaultCollection $/SOME_PATH/dev
This command cloning full history from TFS, but it seems our TFS branch quite large and at some time git-tfs crashed with System.OutOfMemoryException exception. Another time, we failed with exception that max limit of path was exceeded, we found workaround by mapping workspace dir into as short path as possible as follows:
git config --global git-tfs.workspace-dir e:\ws
When we failed with clone command, we went to use quick-clone command. This one cloning starting from any time in history, from any changeset.
git tfs quick-clone -c545532 http://tfs:8080/tfs/DefaultCollection $/SOME_PATH/dev
Option -c545532 here is the number of changeset to starting copying from. Once per year we update all our source files with new header, thus we just to copy from beginning of current year. In that way we should have all necessary history to make branches from shelvesets.
If you hadn't used -c argument here, you would have haven't any history at all, because quick-clone copies just history if you asking for it.
Once repository was cloned, we had written "script" and put it into task scheduler to run every 5 min. What script is doing is just checking for new commits in TFS and creates new branches on our git repository. Again, we use git-tfs here. To get all new commits we call pull command:
git tfs pull
To unshelve TFS shelveset into particular git branch we use unshelve command:
git tfs unshelve -user=TFSDOMAIN\Username "Shelveset Name Here" Branch_Shelveset_Name_Here
This last command creates branch 'Branch_Shelveset_Name_Here' in git from shelveset 'Shelveset Name Here' in TFS. A shelveset's name can contains spaces and some escape chars, so our "script" clean up such cases. As I said, creating branches very cheap on git, thus we haven't any problems with this. If something was pushed into git repo we call crucible API to refresh it.
BTW: To make git repo visible in network I just installed SCM-Server. Crucible was installed and configured to use our domain username/password, thus we get email notification as well. As result we drastically improved step 2 and 3 from our workflow and it works for few months and we are happy with it.
Our workflow became:
Make some changes and shelve code
Wait for our shelveset in crucible (about 6-8 min), create review
Reviewer doing review in crucible
Commit code into 'dev' branch on TFS
Wait while build-server makes successful build
Commit to 'main' branch where production code resides
While working with this I noticed few issues:
Issue1: If you added new file into project and shelved it, you would not see it in git repo, because git-tfs can't find parent commit for it. I'm not sure is it bug of this tool or not, but simplest workaround for this, is having at least one file in shelveset with existing parent. For example, you have added 2 new files and want to send it for review. Instead of creating shelveset with these files, just touch any file which already in git repo (make it pending in Visual Studio), finally you will be able create shelveset with three files (2 new files [add] and 1 for edit [edit]). In that case everything works and git-tfs can unshelve TFS' shelveset into git branch., i.e. we can see it in crucible.
Issue2: One day our HEAD in git repo became detached from "master" branch. Once that happened crucible didn't see new changesets. I have fixed it with command:
git rebase HEAD master
I have created picture how this everything works on our project, may be it could be helpful:
You can integrate Mira and TFS with TaskTop and then use the code review tools built into Visual Studio.
Code Review added in Visual Studio 2012
TaskTop integration with TFS & Jira
These I think are your best options.

Git repository and TFS repository

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

Resources