Forking Github into AzureDevops - github

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.

Related

Azure contributions to github profile

I work for a company that uses Azure Devops and therefore all my contributions are not stored in a github account. Is there any way to transfer them there (obviously without cloning the repository to github)
I tried to find a way to track contributions but they all require direct integration with github, which I can't do.
If you don't want clone contributions from Azure DevOps Repo to local then to GitHub.
you could directly use git import by going to GitHub right upper corner, click the '+' button, put your old repository’s clone URL got from ADO repos then it should be done. You needn't clone the repo to your local.
Then if you want, you could delete the repos/contributions in Azure DevOps.
If the contributions are on GitHub repos, then you needn't track them with integrations. But if they are still in different platforms, then you need to use integration to track them.

Github mirror repository using workflow from another repo

My problem is I have mirror repository on GitHub, that I can't commit into. I have to run some pipelines on this repo. In GitLab CI, it's possible to select CI/CD configuration file from another repo. I searched throught actions repo settings, but I couldn't find anything that would help me. Is that possible in GitHub Actions? Or I have to find some workaround?

how do i automatically pull code from master to fork in azure repos using azure devOps pipeline

I was trying to pull the code from master to fork repository automatically through the azure pipeline. If any one know about this?
If you fork azure repo and want to automatically sync the Fork repo using VSTS Git, please follow below steps.
Supposed the url of original repo is https://dev.azure.com/{organization}/{project}/_git/test, and the url of forked repo is https://dev.azure.com/{organization}/{project}/_git/test_fork.
If you click "Clone" button in test repository, you will see below panel.
Clicking "Generate Git Credentials" button will show the following panel.
So we can use command git remote add upstream https://username:password#dev.azure.com/{organization}/{project}/_git/test to specify it as the upstream of test_fork repo in script.
Now creating a build pipeline using Microsoft-hosted Windows agents, setting the test_fork as the source.
Adding the Command Line task with below script.
git remote add upstream https://username:password#dev.azure.com/{organization}/{project}/_git/test
git fetch upstream
git rebase upstream/master
git push -f origin HEAD:master
Queuing a new build and it will succeed to sync the test_fork repo using VSTS Git.
You can also configure schedules for this pipeline. Now everything is done.
If you use GitHub repo, please refer to this thread for guidance.

Sync some projects from Azure Devops to Github or another solution?

I have a big .NET solution with many projects. Everything is on Azure devops, and working well for the team.
Some of these projects are demo project.
I would like a way to publish the code of these demo projects on github, so they will be publicly available.
I'm looking for a way to publish the code of these specific projects to github.
Does anyone have a way to do that efficiently ?
if you are using any previous source control (ex TFS) first Unattache it ,
i presume you are using VS,
right click the solution then select "Add solution to source control "
since VS 2015 , GitHub is integrated out of the box , log in to your GitHub account(if you are using an older version just download it as an extension )
Below are the visuals
Create a new folder.
Copy to this folder only the projects you want to publish on GitHub.
Create a new Git repo:
git init
git add .
git commit -m "first commit"
Create a new repo on GitHub:
Open cmd and push the new local repo to new GitHub repo.
cd path/to/your-new-folder
git remote add origin https://github.com/{your-user-name}/demo-projcets.git
git push -u origin master

Github for Windows Pull Request for remote Bitbucket Repo

Based on this tutorial I was able to successfully connect Github for Desktop with my remote Bitbucket repo.
Looking at the example tutorial repo I see there is an Pull Request option built in the application - great:
However the option is missing when I chose my remote Bitbucket repo:
I couldn't find any option that is reponsible for this.
Anyone knows what affects this behavior?
"Pull Request" is very much a GitHub feature, associated to GitHub repos.
So For BitBucket, the simplest approach is to push your feature branch to the remote repo (which is a BitBucket one, not a GitHub one), and make your PR from there (from the remote BitBucket web GUI, even within the same repo)
Once the PR is initiated, each push done from the GitHub Desktop will complete said PR.
In Bitbucket go to Settings -> Branch Permissions, and add a new branch permission with your name.
EDIT
https://stackoverflow.com/a/37343356/1544886