将本地 Git 存储库从 IDE 迁移到 Visual Studio Online [英] Migrate local Git repo to Visual Studio Online from IDE

查看:25
本文介绍了将本地 Git 存储库从 IDE 迁移到 Visual Studio Online的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio Online 上创建了一个新的团队项目,我已在 Visual Studio 2013 中连接到该项目.使用 IDE,我将本地 Git 存储库(从 GitHub 拉下)克隆到本地 Git 存储库部分.

当我浏览 Visual Studio 的文档时 过去(其他人需要更改 .git/config 文件).这是否已修复,以便我可以完全使用 IDE?或者我错过了什么?

解决方案

此发布选项仅在您连接到团队项目并且 git 存储库的远程 uri 设置为 TFS uri 时显示.

要解决此问题,您可以手动编辑 git 文件,但我倾向于打开 Git 命令提示符(右键单击存储库并选择打开命令提示符.

在命令行输入:

<块引用>

git remote set-url origin http://[server]:[port]/tfs/[projectcollection]/_git/[ProjectName]

git pull

[[解决任何合并问题]]

git push

I created a new Team Project on Visual Studio Online that I have connected to in Visual Studio 2013. Using the IDE, I cloned a local Git repo (that was pulled down from GitHub) into the Local Git Repositories section.

When I went through the documentation on Visual Studio's website, it showed an option to "Publish to {Team Project}."

Mine doesn't show this:

And it looks like this has been a problem in the past (others have needed to change the .git/config file). Has this been fixed yet so I can use the IDE completely? Or am I missing something?

解决方案

This publish option is only shown when you are connected to a Team Project and when the remote uri of the git repository is set to the TFS uri.

To fix this you can manually edit the git files, but I tend to open the Git Command Prompt (right-click the repo and choose Open Command prompt.

On the command line enter:

git remote set-url origin http://[server]:[port]/tfs/[projectcollection]/_git/[ProjectName]

git pull

[[ resolve any merge issues ]]

git push

这篇关于将本地 Git 存储库从 IDE 迁移到 Visual Studio Online的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆