Recently I began using git tf to interface with a Microsoft TFS repository for a client. I quickly began to encounter problems when trying to merge TFS changesets into my local repository when issuing the git tf pull --rebase command. Sometimes the issues would be simple conflicts, but other times I would encounter bizarre problems that I could not easily resolve.
My solution was to adopt a modified workflow using a local branch, e.g., “Working”. I perform all of my code changes on the Working branch and use master only for TFS interactions. Here is a typical workflow:
- Start my day
- git checkout master
- git tf pull --rebase
- git checkout Working
- git merge master -m “Merged latest changes from TFS.”
- Make changes to the code in my local git repository
- git commit -a -m “commit local into Working branch”
- Merge my local Working changes into master
- git checkout master
- git tf pull --rebase
- git merge Working --no-commit
- Fix any merge conflicts and then check updated code in to TFS
- git tf checkin
- git checkout Working
- Resume local code changes
I have not had any more bizarre, unsolvable problems since adopting this new workflow.
DUDE: thank you! This has become an integral part of escaping Parallels/VS ;)
ReplyDeleteGlad to hear it helped someone! :)
Delete