简体   繁体   中英

Is it possible in git-tfs to add tfs branch/project as additional remote?

I have to work with a messed-up TFS repository. By messed-up I mean the following:

--|- Dev branch ---------|------
  |                      |
 previous branching    new branching
 to release            to release
  |                      |
  |                      |
   -- Release branch --* --------
                       |
                 branch deletion

As you can see, the branching policies are a little bit questionable...

So, my TFS branch was created from Dev branch somewhere between previous branching and the new one, using quick-clone (and quick is due to other messed-up branches). Now I have to synchronize my changes between these two branches ( Dev and Release ) and, obviously, I cannot branch --init the Release branch.

(Attempt to clone the whole repository again with branches did not succeed because of the weirdness of the TFS repository management)

There are two options I am currently aware of:

  1. Resort to TFS for merging
  2. Clone an additional git repository from the Release branch and add this repository as a remote to my repository following the Dev . This will result in continuing working with GIT, but I'm not sure it is worth the effort because of additional overhead of synchronizing the new repository separately.

One other possibility I can think of is addition of the Dev branch as additional remote directly to my current repository. However, I didn't find any way to do it.

My question is whether the above is possible and, in case it isn't, are there any other sane alternatives?

I think that the case n°2 will work. Quickclone the dev branch in a new repository, then add this repository as a remote just the time to fetch the changeset (you could delete the repository after). Then you could Fetch and rcheckin from here.

Ps: which version do you use? The last will be better. If you did 2 'quickclone' for each of the branches, there is an option in the config file to change to better manage branches (I will try to find it's name because I didn't remember and I have not documented it :-( )

Ps2: if you didn't Fetch a merge changeset, git won't help you a lot during merges...

Ps3: There is some restrictions on doing merges with git-tfs: https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/manage_tfs_branches.md#merge-2-branches-and-checkin-this-merge-in-tfs

I hope it will help...

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