XCode and TFS integration in 8 simple steps
After 2 years away from my blog, I will try and write a post which I expect will help people in my office as well as other around the globe. It all began when I saw that XCode has an option for code comparisons and status of the files but it was not usable with TFS and using eclipse was just too “tidy”. You will have to keep track of the files to checkout for edit, keep track of files to add so you dont miss it in checkin etc. So here I present to you an easier way (GIT-TF).
Step 1) Download git-tf from the following link
Step 2) Unzip it in some folder on your local disk. Let us call the folder git-tf (because I have it by the same name on my system) for my ease
Step 3) Now you need to clone your TFS code to your local folder. So suppose you are working on some module and its code is mapped to a folder “XTensions/abc” (it is important that you have it mapped using eclipse like you normally do) then you now need to clone it using git-tf. To do that, first delete the folder “abc” in XTensions. Then go to terminal and write the following commands: (replace paths with your own disk path wherever necessary)
git-tf clone http://myserver:8080/tfs/mycollection $/TeamProjectA/XTensions/abc
If the above commands give you error that you cannot connect to tfs due to proxy, then turn off the proxy, relaunch terminal and try again.
Step 4) Now when you work on any file and change it, it will display its status as “M” if it modified. “A” if it is added etc. See the screenshot below.
Step 5) You can also choose to see only the files which have changes by filtering it by the button at the bottom
Step 6) You are all set now. So when you are done making changes just checkout the files which have some status “Modified” or “added” etc and checkin the files using eclipse like before.
Step 7) Updating your code. The most important and tricky part is this. When you need to update your code (get latest code), all you need to do is go to eclipse and choose “get latest version” like you must be doing right now. But after that come back to xcode, enable the filter to see what all has changed (changed files will have some status) and then right click > choose “committ selected files” from contet menu. See below.
Then add any comment you want, I usually write “Merging changes from <branch name>”. And your code is updated
Step 8) Lastly, if you are working on the file and you need to check what changes you have made. you can do that from within XCode now. Just use the last button in toolbar below
Here you go. Let me know if you need help with anything in the comment section below. Happy coding.