简体   繁体   中英

How to merge changes from Github to TFS

So I'm working semi-remotely on a project for a company with a small team. We have only a single VPN-enabled laptop to access their TFS which remains in a single secure office. We want to use Github to collaborate and get all our work onto the company Laptop, and then transfer that work to the company's TFS.

However I can't find a way to merge changes from the Github repo on the laptop to the TFS repo on the laptop without just brute-force ctrl-c/ctrl-v the directory which does not seem like the ideal solution.

Here is the file situation on the laptop with an arrow indicating the desired change transfer

这是笔记本电脑上的文件情况,带有指示所需更改传输的箭头

Is there any clean way to do this?

You can merge changes from github to TFS repo by below steps:

  1. Move files into subfolder in local github repo

    Assume DEV is the subfolder for TFS git repo root directory, you can create the same folder DEV in github repo, and move files in the subfolder:

     # In local github repo mkdir DEV mv * DEV git add . git commit -m 'move files into DEV folder'
  2. Add local github repo as a remote for local TFS repo

    Assume the local github repo in C:\\GitHub\\My_Workflow_Dashboard,then you can add the local repo as the remote for your local TFS git repo:

     git remote add github C:/GitHub/My_Workflow_Dashboard -f
  3. Merge changes from github into TFS repo

    Then you can merge the changes from github (such as master branch) to TFS by below commands:

     git merge github/master --allow-unrelated-histories git push

    Or you can add -X theirs option ( git merge github/master --allow-unrelated-histories -X theirs ) to auto resolve merge conflicts by keeping the version from github repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM