Tuesday, 15 February 2011

version control - One-to-one mapping of git commits to TFS changesets using git-tfs rcheckin -



version control - One-to-one mapping of git commits to TFS changesets using git-tfs rcheckin -

the context we have git repository release branch. we have tfs repo (currently empty).

my task mirror release branch of git repo tfs every commit in git maps changeset in tfs. developers commit git , (lets assume) unaware of tfs.

reading documentation rcheckin , reply related issue makes me believe rcheckin capable of doing that.

the problem

all commits in git squashed single changeset.

reproduction sequence:

git tfs clone http://tfs:8080 $/tfsrepo cd tfsrepo git remote add together github git@github.com:repo/repo.git git fetch github git merge github/release git tfs rcheckin

this results in single checkin tfs contains commits.

other attempts @ solving problem

after clone, merge first commit source (git) repo, rcheckin create shared base

this worked, subsequent git pull github release followed git-tfs rcheckin led commit squashing again.

for first few commits in origin repo, merged them one-by-one git-tfs shared repo , rcheckin'd after each.

this kind of worked, every commit, there 1 changeset in tfs. however, original commit message sec underneath "merged c02436de4f.." message. it not realistic every changeset, scripting. as pointed out patthoyts, create me commiter alter far tfs concerned. my question

what have maintain tfs up-to-date release branch git-repo every commit in git has corresponding tfs changeset?

additional info

i have administrative command of both repos, , able rebase git repo if necessary, consequences implies. don't want lose history created.

i think you're seeing git-tfs using commits along shortest path between head , tfs/default. tfs's history list of changes, while git's graph, , you're hitting impedance mismatch between two. image of git-tfs seeing, seek git log --graph --oneline --decorate head tfs/default before utilize rcheckin.

if want 1:1::commit:changeset thing, seek this:

git tfs clone http://tfs:8080 $/tfsrepo cd tfsrepo git remote add together github git@github.com:repo/repo.git git fetch github git tfs rcheckin github/release

another approach utilize cherry-pick or rebase.

git tfs clone http://tfs:8080 $/tfsrepo cd tfsrepo git remote add together github git@github.com:repo/repo.git git fetch github git checkout -b about-to-be-rewritten-twice github/release git rebase tfs/default git tfs rcheckin

check out rebase docs more examples of things rebase can do.

and don't git force github about-to-be-rewritten-twice:release.

git version-control tfs git-tfs

No comments:

Post a Comment