On my Azure DevOps I cannot see branches. How can I enable branches?
If you choose TFVC(Team Foundation Version control) as version control when you create a new project, the default repo will have no Branches page.
So, you can choose git as version control when you create new projects or create a new repo in this project. A project can only have one TFVC repository but can have multiple git repositories.
You can refer to the documents and learn more about Git and TFVC in Azure DevOps.
If you use TFVC you can't see the branches in the menu, you will see them under the "Files":
Only if you use Git you will see the Branches in the menu:
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
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 looking into migrating our TFVC repository to Git using the "Import" option provided in Azure DevOps (Repos -> Files -> [New Git Repository] -> 'Import' button).
Our TFVC repo currently has two branches:
$/MyProject/Dev
$/MyProject/Release_1.0 (currently our one and only production version)
The documentation for the "import" option (here) says that "only a single branch will be migrated". If so, how can I migrate both branches to my new Git repository and keep the "relationship" that the branches have with each other? i.e. once in Git I still want to be able to (say) fix a bug in the "Release_1.0" branch and merge the change back into "Dev".
For this issue, agree with Daniel , you can use git-tfs to achieve this migration.
First fetch all the source history (with all branches) in a local git repository:
git tfs clone http://tfs:8080/tfs/DefaultCollection $/project/trunk . --branches=all
Wait quite some time, fetching all the changesets from TFS is even longer.
Pros:
you have all the whole history in the git repository
manage merges between branches! A branch merged in another one will
be materialized in the git repository.
For details ,please refer to this document and issue(clone multiple TFS branches into one Git repo).
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.
I need to rename a TFVC repository in Azure DevOps project. I do not see the option to How to rename a TFVC repository in Azure DevOps project? that:
For Git repositories, however, there is an option to rename a repository:
The TFVC repo follows the name of the Project. By renaming the project the repo should follow.
Open organisation settings
Select General and then projects.
Select the ... menu item on the project and choose Rename
See also:
https://learn.microsoft.com/en-us/azure/devops/organizations/projects/rename-project?view=vsts