2

We've been using git-tfs to import three major folders which lived side-by-side in our TFS repository in three individual Git repositories. Now we want to merge the two of them together using git --filter-branch. Is there a way to do this without breaking the link with TFS so that we can continue fetch any changes that are still being done in TFS?

Dennis Doomen
  • 8,368
  • 1
  • 32
  • 44
  • Why can't you just make a new clone from TFS that includes everything? Or do you have important history that is present only in the git repo? In that case it looks like you are having two masters for info which is bad... – Anders Abel Jan 19 '14 at 14:00
  • I could, but then the tool doesn't allow me to import the branches as real Git branches. – Dennis Doomen Jan 19 '14 at 17:49
  • git-tfs has support for tfs branches. I've used it and it works fine. Only limitation is that you can't perform a proper tfs merge to reintegrate the branch from git; then you'll have to fall back on tfs. – Anders Abel Jan 19 '14 at 19:06
  • @AndersAbel even merge is supported with git-tfs since last version... But with some restrictions due to tfs. – Philippe Jan 20 '14 at 07:29
  • I know and I'm already using that heavily. But what I mean is what happens if I (git) pull one repo into another using git --filter-branch. Will git-tfs still be able to pull changesets from the directory-that-was-once-a-separate-repo? – Dennis Doomen Jan 20 '14 at 07:40
  • if you solve the (easy) problem of having all your branches with the same name, you just have to use the [bootstrap](https://github.com/git-tfs/git-tfs/blob/master/doc/commands/bootstrap.md) command on each imported branches and it should work. Just be sure to not remove the "git-tfs-id: " datas in the commits. Why you plan to use `filter-branch` instead of just a remote pull? Because you want to use grafts to link branches? If so, that should work... – Philippe Jan 20 '14 at 09:37
  • So are you saying that the `git-tfs-id` is the only tracking info git-tfs needs? – Dennis Doomen Jan 20 '14 at 11:46
  • yes. They in fact also need `tfs-remote` infos in the `config` file of the repository but they are extracted from `git-tfs-id` metadatas when running `bootstrap` command. – Philippe Jan 20 '14 at 12:06
  • But the more I read your initial question, the less I understand :( What do you mean with 'Now we want to merge the two of them together using git --filter-branch.'? Some graphical description of your repository and what you expect in the end would have been great! – Philippe Jan 20 '14 at 12:10
  • 1
    That'll be a bit difficult here, but in TFS we had a single repo which contained the folders Main, Releases and Customers. The Releases folders were branches of Main and the Customers folder contained sub-folders with Visual Studio solutions that refer to individual releases. Using `git-tfs` resulted in two independent Git repos, one created from the Main folder (with the Releases converted to real Git branches) and one created from the Customers folder. – Dennis Doomen Jan 21 '14 at 08:05
  • >That'll be a bit difficult here Feel free to modify your question! Now that I understand better your question, you will have no problems, I think... – Philippe Jan 21 '14 at 12:08
  • Thanks for your patience needed to understand my question :-) – Dennis Doomen Jan 21 '14 at 20:24

0 Answers0