I have 2 repositories linked to a project in Azure DevOps.
One repository is GIT and the other is TFVC. I wanted to try out TFVC, but turns out I will continue with GIT for support purposes. So I want to delete the TFVC repository on the project.
I understand that deleting the project will remove the repository, this is not an option for me.
I also know the following command : "tf vc destroy $/TestProject" removes the repository but it is not being removed from Devops completely which is a problem for me.
Other posts seem to be from 2018 about this subject. Is there anything added yet to simply remove a TFVC repository from a project?
The only way is to delete the project and recreate it. Otherwise, destroy is your best option.
Related
Someone upgraded our TFS to Azure Dev Ops a couple of years ago. If I drill down one of the repositories in a project, there are dozens of folders some of which have branches within them. The icon I have boxed in red I assume is a branch:
I have created a brand new repository in DevOps via the browser interface, and while I have been able to create a few folders with projects, files, etc..., I cannot find a way to create a branch within a folder.
In Repo -> Branches, I see a New Branch button, but that branch will be created at the repo root. There does not seem to be a way to place a branch within an existing folder.
Is that correct? If not how can it be done? Perhaps via the command line somehow? Is this structure in the other repo because it was converted/imported from TFS?
There are two version control systems available in Azure DevOps / TFS:
TFVC (Team Foundation Version Control) and Git.
TFVC is a centralized version control system and is considered feature complete and no longer undergoing development. You can have one TFVC repo per Team Project. It supports folder-level branching within the repository. The screenshot you posted is from TFVC.
Git is a modern version control system. It is fundamentally different from TFVC on a deep technical level and does not support folder-level branches; branches are only at the repository level.
If you created a new repository within the team project containing your TFVC repo, it is, by definition, a Git repository.
The branches and merging strategies that you follow for TFVC and for Git are generally not interchangeable because of these core differences.
So to succinctly answer your question: You can't do what you want to do. If you are using Git, please look up common Git branching models such as GitFlow and GitHubFlow and choose one that is appropriate for your development scenarios.
In Repo -> Braches
You could create new branches within an existing folder with the format:
Folder Name/Branch Name
On Github we can set automatically deletion of branches after merge for a repository (like explained here). I want to do this for 30 repositories.
Is there a way to do this by script ?
I typically would like to add a file to each repository.
I think you can do this relatively easily with a script. You can use the GitHub CLI for this. There is the following command with which you can switch on the deletion of the branch after a successful merge for a repository:
gh repo edit [<repository>] --delete-branch-on-merge
If you want to start with the CLI, I guess this is a good starting point.
We accidentally set up a Git repo in a new DevOps project, and now we can't delete it, because MS doesn't allow the deletion of your only git repo. This is becoming problematic because it keeps appearing on some screens and external tools, which can be confusing to users.
We tried disabling the repo, but that just throws an error on some screens that are looking for it.
We tried setting Read permission to Deny, but this just throws permission errors in various places.
So is there a way to completely hide the repo so that it doesn't show anywhere or actually delete it? We set up a TFVC repo and are using that instead, so we don't need the git repo.
It seems odd that MS will allow you to operate a DevOps project without a git repo, but after you create one, it will not allow you to delete it.
I was having the same issue. Here is what I did.
go to your Project Settings -> Repositories
Create a new repository, remember to uncheck the Add a README option
Delete the original repository.
go back to repos, it prompt you set the new repository as default.
now you have an empty repository.
Here are the steps in action
is there a way to clone/download a TFVC repo from azure devops using code?
and migrate to git is not an option the repo should stay in TFVC format.
There used to be an extension for Azure Repos that supported TFVC. But it's been deprecated since. The repo is still there, so you may be able to build a local copy. Or grab the latest (quite old) version.
Your closest alternative is to use the Windows Explorer extensions or Team Explorer. Or using tf vc on the commandline, like many hard-core git users only using git from the cli.
I'm wanting to fork a github repo into AzureDevOps, whilst retaining the capability within AzureDevOps to keep pulling changes from github as-per forking a repo within github.
Is this feasible / on a roadmap?
I'm wanting to fork a github repo into AzureDevOps, whilst retaining the capability within AzureDevOps to keep pulling changes from github as-per forking a repo within github.
I am afraid there is no such out of box function of the "Fork" in GitHub for Azure Devops. But you can import repository from GitHub directly.
In Azure DevOps the project you want to clone the repository or create a new team project, click code tab. Click repository menu in Code Tab (it is on the top left side) and select Import repository:
Then, slect the SourceType GIT and add your github repository URL:
However, according to the ticket on the github:
Currently there is no Azure DevOps' build in support for automatically
updating your GitHub repo fork in Azure Repos.
We need do the sync manually on the dev machine.
Besides, there is an old document about How-To Fork Git Repositories on Visual Studio Online, but we still need to create a middleman to moderate changes from GitHub before pushing them into a VSTS project.
Hope this helps.