如何连接的Visual Studio 2012使用git(github上)?

如何连接的Visual Studio 2012使用git(github上)?

问题描述:

微软推出的Visual Studio 2012可以使用Git(和github上)进行整合,我使用下面的参考的链接的Visual Studio 2012使用Git 的,但我没有得到任何选项来犯我的代码。我是否需要安装/使用Github上的Windows?或者可以用github上直接从Visual Studio集成?

Microsoft launched Visual studio 2012 which can be integrated with git (and github), I'm using the following reference linking visual studio 2012 with git, but am not getting any option to commit my code. Do i need to install/use Github for windows? Or is is possible to integrate with github directly from visual studio?

首先,安装的 的Visual Studio 2012更新3 和的 Visual Studio工具的Git ,以使Git的支持,在2012年你必须确保的混帐的Windows安装(Visual Studio会提示你安装它,如果你还没有这样做)。

First of all, install Visual Studio 2012 Update 3 and the Visual Studio Tools for Git to enable Git support in 2012. And you must ensure that Git for Windows is installed (Visual Studio will prompt you to install it if you haven't done so).

如果你使用的的Visual Studio 2013年或更高版本,Git的支持是内置的,不需要任何插件的安装。

If you're using Visual Studio 2013 or later, Git support is built in and doesn't require any plugin installation.

随后,源控制下,请确保您有微软提供的Git已启用:
选择源代码控制

Then, under Source Control, ensure that you have the "Microsoft Git Provider" enabled:

打开团队资源管理器选项卡。当您单击工具栏中的连接骨节病>按钮(看起来像一个电源插头),请确保你的资料库是根据本地Git仓库上市,或使用克隆骨节病>选项克隆库到系统中。

Open the Team Explorer tab. When you click the connect button in the toolbar (looks like a power plug), make sure your repository is listed under Local Git Repositories, or use the clone option to clone a repository to your system.

当您单击克隆你可以输入现有的GitHub存储库位置,用你的资料库中的HTTPS位置。 Visual Studio中不支持SSH。您可以使用GtiHub库页面上的位置选择器,以获得正确的克隆网址。

When you click clone you can enter an existing GitHub repository location, use the "HTTPS" location of your repository. Visual Studio doesn't support SSH. You can use the location picker on your GtiHub repository page to get the right clone url.

然后最后,未同步提交选项卡上,您可以单击同步同步本地资源库与远程,这将询问您的GitHub的凭据。

Then finally, on the Unsynced Commits tab you can click Sync to synchronize your local repository with the remote, this will ask for your GitHub credentials.

同步

如果您想从头开始创建一个新的存储库,我也不懂怎么做丝毫的想法从UI,但创建后GitHub上的一个空仓库,你应该可以从命令行添加一个新的遥控器。然后Visual Studio将拿起遥控器,让你推入它。

If you want to create a new repository from scratch, I have not the slightest idea of how to do that from the UI, but after creating an empty repository on GitHub, you should be able to add a new remote from the commandline. Visual Studio will then pick up that remote and allow you to push into it.

见的下面GitHub上的步骤来初始化一个空库并设置你的本地库GitHub的之间的联系。一旦你做到这一点,库应该在Visual Studio中显示为好(如果它没有,使用添加了添加骨节病>选项团队资源管理器的连接页)。

See the following steps on github to initialize an empty repository and setup the link between your local repository and github. Once you've done that, the repository should show up in Visual Studio as well (if it doesn't, add it using the add option on the connect page of Team Explorer).