Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no way to sync 2 repositories evolving separatly 100% automaticaly with whatever solution you choose (to achieve automatic sync, you must either achieve a sync in no time or being able to block push in git or check in in TFVC when one of the 2 team begin a sync) .</p> <p>So, you will always have conflicts that you should merge manualy. You could find a workflow that will prevent most of them but never solve all the cases and these remaining cases will be really difficult to solve...</p> <p>Anyway, you could nearly achived what you want (it depends of your expectations : do you need branching support --hard--,...) with git-tfs (I have included in git-tfs all needed to do that but never used in production) but it's a little bit tricky.</p> <p>You need to clone your TFS repository in a <code>bare</code> repository :</p> <p><code>git tfs clone https://server/tfs/TeamCollection $/project/trunk --bare --with-branches</code></p> <p>then you need to write in your <code>post-receive</code> hook of this <code>bare</code> repository something like that (I do not remember if it works) :</p> <pre><code>branch=$(git rev-parse --symbolic --abbrev-ref $1) if [ "master" == "$branch" ]; then branch="default" fi git tfs rcheckin --bare -i $branch </code></pre> <p>With that, every time someone push in the git repository, the commits will be checked in in TFS.</p> <p>For more comfort (otherwise they will always have boring conflicts to solve when they try to push), you could sync git repository with TFS server with a scheduled task with the command (this way they will be aware of new commits sooner) :</p> <pre><code>git tfs fetch --all </code></pre> <p>Note : I don't remember if this command could be used in a <code>bare</code> repository (now that I think about that, I don't think so). Otherwise you will have to use instead <code>git tfs fetch -b=myGitBranch -i tfsRemote</code> for each existing branch :( </p> <p>But I'm sure they will never be able to work with branches that was not already created in tfs :( The git-tfs tool is indeed not able to create automatically a TFVC branch from a git history. Technically, that's achievable, I think, but never developed (because git-tfs is more à tool to run away of TFVC than a tool to check your development in it... ) </p> <p>And some other stuff could be difficult or impossible to do...</p> <p>I hope it will help.</p> <p>PS :</p> <ul> <li>that's a hard job you are trying to do for someone not used to git-tfs...and something I don't recommend to do.</li> <li>I highly recommend to go the same way Microsoft is taking and to migrate everything on git (even staying on TFS server or VSTS if needed), that way the sync will be a lot easier (even if not 100% automatic ;-)). I have made a good doc on how to migrate from TFVC: <a href="https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/migrate_tfs_to_git.md" rel="nofollow noreferrer">https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/migrate_tfs_to_git.md</a></li> <li>Try to convince your enterprise that each team should choose and master its tools and not be imposed some choices. </li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload