Question or issue on macOS:
How to connect Visual Studio Code on mac with Team Foundation Server(TFS).
Or any other way to connect with tfs?
Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications. The Visual Studio Mac native editor shares code with Visual Studio on Windows The C# editor in VS Mac was rewritten by the Visual Studio team after the Microsoft acquisition. It now has what Microsoft calls a 'fully native UI', raising the interesting question of how much of the old MonoDevelop code, which used cross-platform Gtk#, remains in. There is still big difference, but it is being reduced from day to day and in order to understand that one needs some history. Visual Studio for Mac is successor of Xamarin.Studio and Xamarin.Studio was a combination of open source IDE MonoDevelop. Download Visual Studio Code for macOS. Open the browser's download list and locate the downloaded archive. Select the 'magnifying glass' icon to open the archive in Finder. Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad.
How to solve this problem?
Solution no. 1:
This are the steps to effectively connect a TFS (TFVC) Repository to your VS Code on Mac:
INSTALL THE SOFTWARE
- Install Visual Studio Code for Mac (currently here: https://code.visualstudio.com/download).
- Install the TFS extension for VS Code: Go to the Extensions tab in VS Code, Search for TFS and install.
- Install TEE-CLC. Follow this guide: https://www.youtube.com/watch?v=VPNaEIVZfr0&feature=youtu.be.
CREATE A LOCAL TFVC WORKSPACE IN YOUR MAC
Now you need to have a local TFVC Workspace on your machine. If you don’t have one (as it was my case), you need to create it. The following steps are partially extracted from https://stackoverflow.com/a/21785438/2816119.
- Create a local folder where you are going to download and locally store the source code.
Open a Terminal window.
Create a local workspace from your terminal window with the following command:
Map your repository folder to your local folder with the following command:
If everything went well, you’ll see a new sub-folder “.tf” in your local folder.
Open your local folder with VS Code. If everything went well you’ll se after a few seconds the TFVC icons in the bottom bar:
GET THE SOURCE CODE
To get the source code you’ll need to go to the Source Control Tab -> Ellipsis (…) button -> Sync.
Once you press it you’ll see a progress bar moving in the Source Control Tab and you’ll see how the source code is downloaded to your local folder.
ENJOY
Now you can use your TFVC repository as described in their guides.
If something is not clear or you have questions please let me know. I’ll try to help you 🙂
Solution no. 2:
Get the software
- tee-clc (can be installed with HomeBrew), which depends on
- Java 6, 7, or 8 (see How to install Java 8 on Mac — as of this writing, Java 9 will not work.)
Create a workspace using tee-clc (“tf”)
Tell tee-clc to remember your credentials (in OSX’s Keychain) by adding this line to your .bash_profile
. Then close and reopen your terminal or just paste the same command.
Accept the EULA.
Create a workspace.
Map a path on the server to a local folder.
Get the code and store your password. Make sure you type your actual username; if you enter your_username
here it may get stored in the OSX Keychain and tee-clc is really dumb about replacing it later.
If it works, it will download your code to that folder. You can also use the other commands.
Use the Azure Repos Extension on VS Code
Get the Azure Repos extension.
Add the following settings (CMD+,):
Type which tf
in Terminal to find out what the value for location should be. I’m not sure if “restrictWorkspace” is necessary. I got it from a comment on Github while I was troubleshooting.
Finally, open the folder containing your code. From the command palette (⌘+⇧+P) type Team: Signin
. If that works, you can start using the other features in the plugin.
Solution no. 3:
GIT
VS Code ships with a Git source control manager (SCM) extension. Most of the source control UI and work flows are common across SCM extensions.
More details please refer this tutorial:Using Version Control in VS Code
Note:VS Code will leverage your machine’s Git installation, so you need to install Git first before you get these features. Make sure you install at least version 2.0.0.
TFVC
You can connect to TFVC using the Visual Studio Team Services extension since version 1.116.0 (2017/04/12).
Note:You need Team Foundation Server 2015 Update 2 or later.
Solution no. 4:
Check the below link. It is working fine for me
Steps to be followed:
Step 1: Install Eclipse
Step 2: Download and install the TFS everywhere plugin
Step 3: Checkout your solution using the eclipse to a local folder
Step 4: Open the solution in Visual studio and make the code changes
Step 5: Open eclipse and commit your changes.
Hope this helps!
Using GitHub with Visual Studio Code lets you share your source code and collaborate with others. GitHub integration is provided through the GitHub Pull Requests and Issues extension.
To get started with the GitHub in VS Code, you'll need to create an account and install the GitHub Pull Requests and Issues extension. In this topic, we'll demonstrate how you can use some of your favorite parts of GitHub without leaving VS Code.
If you're new to source control and want to start there, you can learn about VS Code's source control integration.
Getting started with GitHub Pull Requests and Issues
Once you've installed the GitHub Pull Requests and Issues extension, you'll need to sign in. Follow the prompts to authenticate with GitHub in the browser and return to VS Code.
If you are not redirected to VS Code, you can add your authorization token manually. In the browser window, you will receive your authorization token. Copy the token, and switch back to VS Code. Select Signing in to github.com... in the Status bar, paste the token, and hit Enter.
Vs Code Macros
Setting up a repository
Cloning a repository
You can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by using the Clone Repository button in the Source Control view (available when you have no folder open).
Authenticating with an existing repository
Enabling authentication through GitHub happens when you run any Git action in VS Code that requires GitHub authentication, such as pushing to a repository that you're a member of or cloning a private repository. You don't need to have any special extensions installed for authentication; it is built into VS Code so that you can efficiently manage your repository.
When you do something that requires GitHub authentication, you'll see a prompt to sign in:
Follow the steps to sign into GitHub and return to VS Code. If authenticating with an existing repository doesn’t work automatically, you may need to manually provide a personal access token. See Personal Access Token authentication for more information.
Note that there are several ways to authenticate to GitHub, including using your username and password with two-factor authentication (2FA), a personal access token, or an SSH key. See About authentication to GitHub for more information and details about each option.
Editor integration
Hovers
When you have a repository open and a user is @-mentioned, you can hover over that username and see a GitHub-style hover.
There is a similar hover for #-mentioned issue numbers, full GitHub issue URLs, and repository specified issues.
Suggestions
User suggestions are triggered by the '@' character and issue suggestions are triggered by the '#' character. Suggestions are available in the editor and in the Source Control view's input box.
The issues that appear in the suggestion can be configured with the GitHub Issues: Queries (githubIssues.queries
) setting. The queries use the GitHub search syntax.
You can also configure which files show these suggestions using the settings GitHub Issues: Ignore Completion Trigger (githubIssues.ignoreCompletionTrigger
) and GitHub Issues: Ignore User Completion Trigger (githubIssues.ignoreUserCompletionTrigger
). These settings take an array of language identifiers to specify the file types.
Pull requests
From the Pull Requests view you can view, manage, and create pull requests.
The queries used to display pull requests can be configured with the GitHub Pull Requests: Queries (githubPullRequests.queries
) setting and use the GitHub search syntax.
Creating Pull Requests
You can use the GitHub Pull Requests: Create Pull Request command or use the + button in the Pull Requests view to create a pull request. If you have not already pushed your branch to a remote, the extension will do this for you. You can use the last commit message, the branch name, or write a custom title for the pull request. If your repository has a pull request template, this will automatically be used for the description.
Reviewing
Pull requests can be reviewed from the Pull Requests view. You can assign reviewers and labels, add comments, approve, close, and merge all from the pull request description.
From the description page, you can also easily checkout the pull request locally using the Checkout button. This will add a new Changes in Pull Request view from which you can view diffs of the current changes as well as all commits and the changes within these commits. Files that have been commented on are decorated with a diamond icon. To view the file on disk, you can use the Open File inline action.
The diff editors from this view use the local file, so file navigation, IntelliSense, and editing work as normal. You can add comments within the editor on these diffs. Both adding single comments and creating a whole review is supported.
Issues
Vs Code Macbook
Creating issues
Issues can be created from the + button in the Issues view and by using the GitHub Issues: Create Issue from Selection and GitHub Issues: Create Issue from Clipboard commands. They can also be created using a Code Action for 'TODO' comments.
You can configure the trigger for the Code Action using the GitHub Issues: Create Issue Triggers (githubIssues.createIssueTriggers
) setting.
The default issue triggers are:
Working on issues
From the Issues view, you can see your issues and work on them. By default, when you start working on an issue, a branch will be created for you. You can configure the name of the branch using the GitHub Issues: Working Issue Branch (githubIssues.workingIssueBranch
) setting. The commit message input box in the Source Control view will be populated with a commit message, which can be configured with GitHub Issues: Working Issue Format SCM (githubIssues.workingIssueFormatScm
).
Uninstall Vs Code Mac
If your workflow doesn't involve creating a branch, or if you want to be prompted to enter a branch name every time, you can skip that step by turning off the GitHub Issues: Use Branch For Issues (githubIssues.useBranchForIssues
) setting.