Skip to content

Instantly share code, notes, and snippets.

@program247365
Forked from briangershon/gist:832491
Created May 9, 2011 20:08
Show Gist options
  • Save program247365/963273 to your computer and use it in GitHub Desktop.
Save program247365/963273 to your computer and use it in GitHub Desktop.
Integrating Git on Mac OSX with Microsoft TFS on Windows

Integrating Git on Mac OSX with Microsoft TFS on Windows

Here's an experiment to work locally on a Mac using Git and my editor of choice -- while integrating well with Microsoft TFS which houses company-wide code.

If you want to work completely in Windows see:

Goals

  • On Windows running in a VM, use TFS normally for checking out branches, and checking in company-wide code.

  • On Mac OSX, use Git and my editor of choice to work locally.

  • Make it easy to go back and forth between my local Git repo, and company-wide changes in TFS.

Windows Setup

  1. Do all the normal TFS setup on Windows in VMWare Fusion.

  2. Check out your branch into a folder.

  3. Share that folder with your Mac via Windows Sharing.

Mac Setup

  1. On Mac, connect to Windows via SMB. Now you should see your branch in /Volumes/[branch-name-here]

  2. cd /Volumes/[branch-name-here]

  3. Initialize git repo via git init

  4. Turn off auto.crlf via git config core.autocrlf false. Why? Since this is a local repository and line endings aren't really an issue, auto-converting them to the recommended LF via auto.crlf=input Git config setting creates slow Git operations on large trees since it has to continually do the LF <-> CRLF conversion on diffs, status, etc. If this were a public repo with line-ending issues then it makes sense to http://help.github.com/dealing-with-lineendings.

  5. In my case I just want to use git with one folder in the root of the repo, so I added the other files/folders into a .gitignore file so Git doesn't remind me about those Untracked files.

  6. Another suggestion for large trees may be to be more selective in .gitignore (to exclude images, assets, binaries, etc) so less for Git to worry about.

  7. git add your .gitignore(s) and files/folders of interest.

  8. git commit -a

Developer Workflow

  1. On Windows in TFS, check-out files you want to work with in TFS so it recognizes changes made in the filesystem (and removes the read-only flag).

  2. On Mac, make changes locally using Git and your local editor. Keep iterating.

  3. When you're ready, go back to TFS and check your files in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment