Reputation: 769
My company currently works mostly with TFS as our Source Control server. We do all our teamwork on it. However, we'd also like to publish our projects comfortably in an open source format within the organization, so we've set up a local Github with a Git server.
I've used the Git Plugin for Visual Studio 2012 to push one of my projects to this server. This proved successful, however, required me to copy the existing solution bound to TFS, to another directory in order to 'lose' the TFS bindings. If my team makes any changes on the TFS solution, I'll need to manually re-apply them for the Git-bound solution.
Is it possible to switch between source controls on the same solution?
At this moment, switching entirely to Git is not an option. TFS is currently much more reliable for us and is backed by the company.
Upvotes: 3
Views: 1703
Reputation: 57
This can be also done with symbolic links.
mklink /J C:\MyNewGitFolder C:\MyTFSProjectFolder
How to add my current project to an already existing GitHub repository
Upvotes: 0
Reputation: 379
Git-tf is the way to go (as commented by @DaveShaw). This should work :
First, clone your TFS repo with git-tf.
You may want to use --shallow
if your tfs history is long and you only want a quick clone, but you won't have the entire history, just the last commit (like it was the first one).
git tf clone --shallow http://myserver:8080/tfs/mycollection $/TeamProjectA/Main
Add your GitHub repo as a remote
git remote add github https://github.com/<user>/<repo>.git
The simplest thing then is to delete the current github history with the new tfs history
git push github master --force
Then, whenever you want to update your github repo, follow this steps (--deep
will make every following tfs commit a git commit, the opposite of --shallow
)
git tf pull --deep
git push github master
Upvotes: 2