Skip to content

Instantly share code, notes, and snippets.

@chris-pilcher
Last active August 17, 2023 09:52
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save chris-pilcher/a3f14eb081d7ab983e5c to your computer and use it in GitHub Desktop.
Save chris-pilcher/a3f14eb081d7ab983e5c to your computer and use it in GitHub Desktop.
Using TFS Online TFVC with command-line TFS utility on Mac

Install Command-Line TFS using HomeBrew on a Mac

Install Team Explorer Everywhere Command Line Client

  • Press Command+Space and type Terminal and press enter/return key.
  • Install HomeBrew by running command in Terminal app
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • Run:
brew install tee-clc
  • Accept EULA
tf eula

Configure Alternate Authentication Credentials in TFS Online

  • My Profile
  • Security
  • Alternate authentication credentials
  • Enable alternate authentication credentials

alternate authentication credentials screenshot

Create Workspace and Checkout

export TF_AUTO_SAVE_CREDENTIALS=1
tf workspace -new CompanyUniversal -collection:https://company.visualstudio.com/DefaultCollection
tf workfold -map $/Company/Company.Universal -workspace:CompanyUniversal /Users/chris/Documents/Development/iOS/Company
tf get

Commit changes

tf add * /recursive
tf status
tf checkin -comment:"Added test file from MAC tfs" -associate:7720

Configuring SourceGear DiffMerge to Compare Items

Download & install SourceGear DiffMerge

export TF_DIFF_COMMAND='diffmerge --title1="%6" --title2="%7" "%1" "%2"'

# Diff all changes
tf diff

# Diff single file
tf diff /Users/chris/Documents/Development/iOS/Company/Company.Universal.iOS/Info.plist

Other useful commands

tf undo /Users/chris/Documents/Development/iOS/Company/Company.Universal.iOS/AppDelegate.cs
@dasassygoat
Copy link

I know this is a pretty dated comment but I was getting the same error a day or so ago, I removed the -"DefaultCollection" part from the https path and was able to get past that error. Thought I would offer that incase its helpful to anyone.

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