Our client is using TFS, and we are using GitHub
I would like to sync the projects from TFS to Github and from GItHub to TFS as batch process whenever the changes are made in either of them.
Can someone suggest easiest way of doing the same?
Thanks in advance
git-tfs which is a two-way bridge between TFS (Team Foundation Server) and git. However if you are using TFS2013 and later, you could use Git as the source control option. You could directly use normal git command such as git pull, git push.
For the command to the get from github, just use the normal git command such as: git-scm.com/docs/git-pull –
In Azure Devops or Github, both of them use git as their Version Control, so you can have both as separate git remotes.
You could just use some git commands to handle this. Which command please take a look at this blog.
For automated process, then you could use one CI build definition to achieve it. Detail steps as below:
Create a CI build with a PowerShell or cmd Task;
Select the VSTS git repo in Get sources step;
Enable continuous integration andspecify include all branches for
Branch filters:
Two samples for your reference:
How to synchronize VSTS and Github respositories when commits are made
Syncing my Github repo to MS Visual Studio Team Services
Besides, you could also use some 3-rd party extension to handle this, such as this one--Git Tools for Azure DevOps
Azure Pipelines Build and Release extension that helps you synchronise one Git Repository with another.
You can use this extension with any Git repository: TFS, GitHub, Azure DevOps, Git, etc.
Related
There is one public source repo in github where all the source code is present. There is another github repo of mine which has some configuration files.
I want to run some tests of source repo using the configuration file present in my github repo using Azure pipeline task.
How can I checkout to source repo of github first and then do initial setup like build in that repo? And after that copy configuration files from my another github repo to the source repo directory and run tests of source repo.
I want to do these steps in Azure yaml pipelines as from azure release pipelines not all the artifacts are accessible.
Checking out multiple repos is possible, also with GitHub as a source, but don't forget to setup a GitHub service connection.
More info and options about this see: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#specify-multiple-repositories
Since you want the GitHub repo to trigger the Azure DevOps pipeline, please check out the feature that is available since October 2022:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/github-actions?view=azure-devops
I am using Azure DevOps for my source control. I am creating Kibana Dashboard and wondering if it can be source control as well using Azure DevOps. My idea is:
Create Repo in Azure DevOps.
Write automated script(code) so it saves current Kibana Dashboard Saved Object into Azure DevOps.
In this way, I have old Dashboard in the repo. Has anyone done this? It doesn't have to be Azure DevOps, if you have any experience with it, please share with me. I am new to version control.
(https://docs.logz.io/api/cookbook/backing-up-kibana-objects-to-github.html < this was using github)
Kibana Dashboard version control?
The first thing to point out is that Azure devops is not a version control tool. It provides developer services to support teams to plan work, collaborate on code development, and build and deploy applications. Developers can work in the cloud using Azure DevOps Services or on-premises using Azure DevOps Server.
And Azure repo supports two types of version control methods: Git (distributed) and Team Foundation Version Control (TFVC):
What is source control?
You could set the version control type when you create the project:
After that, we could get the URL of the repo is also a git repo:
Git in Visual Studio and Azure DevOps is standard Git, github is the same.
So, that document also applies to azure devops, we just need to replace the github repo link to the azure devops repo link.
In this way, I have old Dashboard in the repo. Has anyone done this?
If you have old Dashboard in the azure devops repo, just clone the old json files to the local and update the json files and push it to the azure devops by git command line. Or you could modify the json files in the azure devops repo UI directly.
So, for the azure devops, you just need to make sure the Version control of your repo is git, and then you can handle azure repo like git.
I want to pull and push code from my local ubuntu machine to Azure Repo. I have used repo type tfvc. How can we perform this option from Linux machine?
How pull and push code in tfvc repo in Azure DevOps Organization?
First we need install the Visual Studio code on Linux.
Then, we could use the official Azure Repos which released by Microsoft.
It supports both TFVC and GIT version control type.
Create your TFVC workspace
With TFVC, the extension uses information about the current workspace
to determine how to connect to Team Services (or your Team Foundation
Server). Workspaces can be created using the Visual Studio IDE,
Eclipse or with the JetBrains IDEs (e.g, Android Studio, IntelliJ).
Note: At this time, you will need to have a local TFVC workspace already available on your local machine. More information about the
difference between the two types (and how to determine which one
you're using) can be found here.
You could also take a look at below videos to help get you started using the extension quickly:
TFVC Source Code Control for Visual Studio Code - This video shows
you how to set up the TFVC support on Windows and demonstrates much
of the functionality available for Team Foundation Version Control.
Above is for windows machine, if you are working on Linux, please take a look at this similar answer.
Hope this helps.
First Download Team Explorer Everywhere client - https://github.com/Microsoft/team-explorer-everywhere/releases
Then on Download Azure DevOps Services Plugin for IntelliJ IDEA --https://learn.microsoft.com/en-us/previous-versions/azure/devops/java/download-intellij-plug-in?view=azure-devops
Select get from Version Control
Then select your Azure TFVC DevOps Repo and then clone.select AzureDevops TFVC
I have Azure Dev Ops on premise which has a bunch of files that are checked out to a user on a machine that no longer exists. How can I undo the check-out of those files? I used to be able to do this through TFS Power Tools; but, there does not seem to be a tool that does the same thing for Azure Dev Ops. Is there a GIT command that will do this instead? How do I clean up Azure Dev Ops file check-outs?
Thank you in advance.
Git is a distributed version control system. Each developer has a copy of the source repository on their dev machine. So it's supposed you are using TFVC version control, there is no GIT commands to work with TFVC version control. Check Git & TFVC.
TFS Power Tools is a client extension which needs to be installed by each user locally for their own version of VS. If you want to use Power Tools, you can use VS/Team Explorer 2015 and earlier versions.
You could use tf undo command to delete Team Foundation version control pending changes in another user's workspace:
tf undo /workspace:OtherUserWorkspace;OtherUser $/TeamProject /recursive /collection:http://YourTFSServer:8080/tfs/YourCollection
Check following link for more details:
https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/undo-changes-another-user-workspace?view=azure-devops
I would like to have a AzureDevOps internal git repository that is a forked version of an external open source library. Is it possible for AzureDevOps to have some way of automatically syncing with the external repo everyday?
I guess if it's not possible, I can have a script that automatically pulls from external and pushes to internal repo everyday.
If this is hosted on Github you can fork it and then trigger Azure DevOps pipeline on this fork change.