git Visual Studio 2013 和 BitBucket
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18836351/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2013 and BitBucket
提问by Dean Chalk
Visual Studio 2013 apparently has some nice slick Git integration.
Visual Studio 2013 显然有一些漂亮的 Git 集成。
However, after an hour of head-scratching with absolutely nothing making even the slightest bit of sense, I've only been able to create a local repository and despite cloning a remote bitbucket repository I simply cannot find a way to publish to my remote repository.
然而,经过一个小时的挠头,完全没有任何意义,我只能创建一个本地存储库,尽管克隆了一个远程 bitbucket 存储库,但我根本找不到发布到我的远程存储库的方法.
I've used TFS, Subversion, Perforce and just about everything else, but this is completely baffling, with no instructions and a completely un-intuitive user interface.
我使用过 TFS、Subversion、Perforce 和其他几乎所有东西,但这完全令人困惑,没有说明,用户界面完全不直观。
Any ideas anyone ?
任何人的想法?
回答by Tim Cavanaugh
John's statement that "you need Team Foundation Server" to work with BitBucket is not correct.
约翰关于“您需要 Team Foundation Server”才能使用 BitBucket 的说法是不正确的。
I just published a project to BitBucket from Visual Studio 2013 (preview version). Here's how.
我刚刚从 Visual Studio 2013(预览版)向 BitBucket 发布了一个项目。就是这样。
- Add solution to Source Control
- 将解决方案添加到源代码管理
- Commit to local Git
- 提交到本地 Git
- In the "Changes" area, click "Commits". This takes you to the dialog where you can publish to a Remote Repository.
- 在“更改”区域中,单击“提交”。这会将您带到可以发布到远程存储库的对话框。
- Enter the URL to your BitBucket repository (must already exist in BitBucket and must be empty) and click "Publish"
- 输入您的 BitBucket 存储库的 URL(必须已存在于 BitBucket 中且必须为空),然后单击“发布”
- Enter your BitBucket credentials when prompted. After the publish finishes you'll get a results message like this.
- 出现提示时输入您的 BitBucket 凭据。发布完成后,您将收到这样的结果消息。
- Use the "Sync" button to update BitBucket with your local commits
- 使用“同步”按钮使用本地提交更新 BitBucket
回答by Ivon Guo
Well, it's actually pretty easy to use GIT on MSVS 2013. You should be able to find a Clone button from the Team Explorer. Simply click on it and it will let you clone from any URL which means you can put Bitbucket link over there too.
嗯,实际上在 MSVS 2013 上使用 GIT 非常容易。您应该能够从团队资源管理器中找到一个克隆按钮。只需单击它,它就会让您从任何 URL 进行克隆,这意味着您也可以将 Bitbucket 链接放在那里。
And once it's synced, you are good to go.
一旦同步,您就可以开始了。
回答by John Zabroski
Visual Studio 2013's "slick Git integration" requires Team Explorer, which means you need Team Foundation Server. To enable it, open your solution, go to Tools -> Options -> Source Control -> Microsoft Git Provider.
Visual Studio 2013 的“巧妙的 Git 集成”需要 Team Explorer ,这意味着您需要 Team Foundation Server。要启用它,请打开您的解决方案,转至工具 -> 选项 -> 源代码管理 -> Microsoft Git Provider。
You may be better off getting the Git Source Control Provider plug-in. See this answer on how to install this plug-in for Visual Studio 2013: https://stackoverflow.com/a/18882284/1040437
获取 Git Source Control Provider 插件可能会更好。请参阅有关如何为 Visual Studio 2013 安装此插件的答案:https: //stackoverflow.com/a/18882284/1040437
Also, considering the power of the git command line, I do not think, based on the screenshots I have seenusing it, the integration is all that slick. It seems rigid, and as somebody has already commented, you may be better off using TortoiseGit. Anyone who has used TortoiseSVN on your team will instantly find it familiar. Some of my coworkers use the command line, and they are divided between Git Bash and Posh-Git.
此外,考虑到 git 命令行的强大功能,根据我看到的使用它的屏幕截图,我认为集成并不是那么流畅。这似乎很僵化,正如有人已经评论过的那样,您最好使用 TortoiseGit。任何在您的团队中使用过 TortoiseSVN 的人都会立即觉得它很熟悉。我的一些同事使用命令行,他们分为 Git Bash 和 Posh-Git。
My main gripe with the Visual Studio integration is it only supports one workflow. Take a look at how toolchains like Atlassian's Stash support multiple different development workflows and how Stash changes depending on your git workflow. This is a more intelligent way to design IDE-like features around git source control repository.
我对 Visual Studio 集成的主要抱怨是它只支持一种工作流。看看像 Atlassian 的 Stash 这样的工具链如何支持多种不同的开发工作流程,以及 Stash 如何根据您的 git 工作流程而变化。这是围绕 git 源代码控制存储库设计类似 IDE 的功能的一种更智能的方法。
Our particular workflow set-up at work is especially resistant to the "common scenario" in modern SaaS development, where you have one main line of development and no cherrypicking/rebasing ever, because you always march forward and upgrade everyone to the latest code. We currently have 7 lines of development...
我们在工作中的特定工作流程设置特别能抵抗现代 SaaS 开发中的“常见场景”,在这种情况下,您只有一条开发主线,并且永远不会挑选/变基,因为您总是向前推进并将每个人升级到最新代码。我们目前有7条开发线...
That said, I have found this article via googling "Visual Studio 2013 git": http://msdn.microsoft.com/en-us/library/vstudio/hh850437(v=vs.120).aspx
也就是说,我通过谷歌搜索“Visual Studio 2013 git”找到了这篇文章:http: //msdn.microsoft.com/en-us/library/vstudio/hh850437(v=vs.120) .aspx
回答by Selwyn
Found this step by step tutorial on the answers.atlassian.com helpful (FOR VS2015and git bitbucket.org)
在 answers.atlassian.com 上发现这个循序渐进的教程很有帮助(对于 VS2015和 git bitbucket.org)
- From the Bitbucket website, create a new repository by clicking on your profile icon, and then go to "View Profile".
- Here you will find the "Create Repository" button. Click it. – I have no idea why this button is located here.
- Give your repository a new name. For consistency's sake, I name my repository the same name as the solution.
- Click the "Create Repository" button
- Once your new repository has been successfully created, go to the ellipsis menu button on the left, and then click on the "Clone" menu item.
- Copy the HTTP URL provided.
- Now let's go to our Visual Studio 2015 and open your existing project!
- In your "Solution Explorer", right click on your solution name, and select "Add Solution to Source Control ...".
- Go to your "Team Explorer" and click on the "Manage Connections" icon on the top.
- Double click on your Repository name under the "Local Git Repositories" section.
- Now click on the "Sync" menu option.
- Under the "Publish to Remote Repository", click the "Get Started" link.
- Paste your URL within the highlighted box, and click "Publish".
- Now go back to the BitBucket website. From the top menu click on the "Repositories", and click on your repository name. You will now see your project files. Reminder: After modifying a file, your changes get "checked in" only when you "Commit" changes and then "Sync" the repository. You can do this by following these steps.
- In the "Solution Explorer", right click on your file after saving your changes, and select "Commit".
- Enter your comments, and click the "Commit All" button.
- Go back to "Manage Connections" within the "Team Explorer" and then under the "Local Git Repositories", double click on your repository's name. Click the "Sync" menu item.
- Click the "Sync" link.
- Go back to the Bit Bucket website and open the file within your repository's directory and you will see your changes in there.
- 在 Bitbucket 网站上,通过单击您的个人资料图标创建一个新的存储库,然后转到“查看个人资料”。
- 在这里,您将找到“创建存储库”按钮。点击它。– 我不知道为什么这个按钮在这里。
- 为您的存储库指定一个新名称。为了保持一致性,我将我的存储库命名为与解决方案相同的名称。
- 单击“创建存储库”按钮
- 成功创建新存储库后,转到左侧的省略号菜单按钮,然后单击“克隆”菜单项。
- 复制提供的 HTTP URL。
- 现在让我们转到 Visual Studio 2015 并打开您现有的项目!
- 在您的“解决方案资源管理器”中,右键单击您的解决方案名称,然后选择“将解决方案添加到源代码管理...”。
- 转到您的“团队资源管理器”并单击顶部的“管理连接”图标。
- 在“本地 Git 存储库”部分下双击您的存储库名称。
- 现在单击“同步”菜单选项。
- 在“发布到远程存储库”下,单击“入门”链接。
- 将您的 URL 粘贴到突出显示的框中,然后单击“发布”。
- 现在回到 BitBucket 网站。从顶部菜单中单击“存储库”,然后单击您的存储库名称。您现在将看到您的项目文件。提醒:修改文件后,只有当您“提交”更改然后“同步”存储库时,您的更改才会“签入”。您可以按照以下步骤执行此操作。
- 在“解决方案资源管理器”中,保存更改后右键单击您的文件,然后选择“提交”。
- 输入您的评论,然后单击“全部提交”按钮。
- 返回“团队资源管理器”中的“管理连接”,然后在“本地 Git 存储库”下,双击您的存储库名称。单击“同步”菜单项。
- 单击“同步”链接。
- 返回 Bit Bucket 网站并打开存储库目录中的文件,您将在那里看到您的更改。
source: https://answers.atlassian.com/questions/39574410/bit-bucket-and-visual-studio-2015
来源:https: //answers.atlassian.com/questions/39574410/bit-bucket-and-visual-studio-2015
回答by MistyK
There is an extension to do it now - Visual Studio Bitbucket Extension https://visualstudiogallery.msdn.microsoft.com/6f8954a6-2358-4f4a-b69b-e51199935fad
现在有一个扩展可以做 - Visual Studio Bitbucket Extension https://visualstudiogallery.msdn.microsoft.com/6f8954a6-2358-4f4a-b69b-e51199935fad
This extension was submitted to devpost contest where you can find screenshots. http://devpost.com/software/bitbucket-extension-for-visual-studio
此扩展已提交给 devpost 竞赛,您可以在其中找到屏幕截图。 http://devpost.com/software/bitbucket-extension-for-visual-studio
When installing visual studio there is an option to include GitHub extensions. This extension is a counterpart for Bitbucket. It allows you to Create/Clone/Publish Bitbucket Git repositories in a very simple way. Once you login you can create new repository and publish it to Bitbucket. If you have existing bitbucket repositories you can list them and choose which one you want to clone. In addition you get access to pull requests from actual repository. You can create new pull requests, approve/disapprove them and also view details like files changed, commits and comments.
安装 Visual Studio 时,可以选择包含 GitHub 扩展。这个扩展是 Bitbucket 的对应。它允许您以非常简单的方式创建/克隆/发布 Bitbucket Git 存储库。登录后,您可以创建新存储库并将其发布到 Bitbucket。如果您有现有的 bitbucket 存储库,则可以列出它们并选择要克隆的存储库。此外,您可以访问来自实际存储库的拉取请求。您可以创建新的拉取请求,批准/拒绝它们,还可以查看更改的文件、提交和评论等详细信息。