- Λήψη συνδέσμου
- X
- Ηλεκτρονικό ταχυδρομείο
- Άλλες εφαρμογές
So, your manager sent you a URL and told you to go fix that little C# library that causes all that trouble, which, by the way, is hosted on a git server somewhere online. You have to send him back the new dll ASAP so that his promotion is not at stake. The bad news is that you have no clue how you do that -after all you are a Java developer and use SVN. The good news is that you found this blog.
Worry no more, this 6-post-long quick guide is here for you to walk you through using the Visual Studio 2015 Git plugin to effortlessly accompish the following things:
1. clone a repository (presented in this post)
2. create a branch
3. commit changes
4. merge branches
5. pull changes from the repository
6. push your commited changes to the repository
The idea here is to help beginners use the VS2015 Git plugin to quickly set up their environment so that their managers get their promotions and they skip studying the command-line git dissertation help pages or wandering through the UI of Visual Studio. Plus, you avoid installing any additional software.
1. Cloning a repository
First, let's assume that the above-mentioned "little library" is ZeroFormatter (a fast serialization/deserialization library for C#). So you google it and end up at: https://github.com/neuecc/ZeroFormatter.
Click on "Clone or Download" button on the left and copy the URL that is selected in the above image (https://github.com/neuecc/ZeroFormatter.git). This is the URL of the repository and you will use it to tell Visual Studio where to download the code from.
Click on "Clone or Download" button on the left and copy the URL that is selected in the above image (https://github.com/neuecc/ZeroFormatter.git). This is the URL of the repository and you will use it to tell Visual Studio where to download the code from.
Open Visual Studio 2015 and choose "Open from Source Control..." on the top left of the Start page (or follow File > Open > Open from Source Control)
The Team Explorer - Connect window shows up on the right of the screen.
Select the "Clone" option in "Local Git Repositories" and paste the Git repository URL you copied earlier. Also, select a folder to place the code that will be downloaded.
Click on the Clone button and wait until the repository is cloned.
Visual Studio informs you with regard to the progress of the download and of course you can always cancel it.
Once done, the Team Explorer - Connect view will look like this:
So now, the Git plugin is "connected" to the ZeroFormatter repository and by clicking the home button on the top (third icon from the left) you will be able to view the basic VS2015 Git plugin menu (Changes, Branches, Sync, Settings). The plugin detects and displays any .sln files included in the downloaded code so that you can just double click on one of them and open the respective solution.
Visual Studio will then attempt to load the solution you selected and during this process it may be required to restore packages or install software/plugins. In our example, certain packages may be restored and the Visual Studio Extensibility Tools may be required to be installed (if not already installed). Fortunally, Microsoft has done a fairly good job at automating/guiding the user in completing such steps.
Once done, you will be able to explore the solution through the Solution Explorer, just like you would do with any other solution.
Next part: creating a branch... (soon).
Σχόλια
Δημοσίευση σχολίου