【问题标题】:How to move local GitHub Visual Studio Projects to BitBucket如何将本地 GitHub Visual Studio 项目移动到 BitBucket
【发布时间】:2019-10-31 15:34:46
【问题描述】:

我最近丢失了安装了 Google Authenticate 的手机,并且我曾经访问过我的 GitHub 帐户。这意味着我无法再登录 GitHub。

我已向 GitHub 发送电子邮件,他们告诉我我没有设置“后备”身份验证方法,因此无法再登录。

我有大约 30 个 Visual Studio 项目要转移到我在 BitBucket 上的帐户。它们在我的“D”盘和 GitHub 上。

如果可能的话,我希望保留项目创建后的所有代码更改?

谁能解释一下重新配置 VS 并将项目移动到 BitBucket 的最佳方法吗?

【问题讨论】:

    标签: github bitbucket


    【解决方案1】:

    从您的本地驱动器,这应该是一个简单的问题:

    • 创建一个空的 BitBucket 存储库 (as shown here)
    • 将远程源重命名为 BitBucket URL
    • 推动一切

    即:

    cd D:\path\to\one\project
    git remote set-url origin https://bitbucket.org/<you>/yourProject.git
    git push --all
    

    确保您已将 git config credential.helper 设置为 manager:这将缓存您的凭据(BitBucket 用户名/密码)

    Visual Studio 将自动选择新 URL,因为该 URL 与默认远程“origin”相关联。

    OP Trevor Daniel 加上in the comments

    我做的唯一额外的事情是,在 VS 中,更改“Remotes” URL 以匹配 Team Explorer &gt; Home &gt; Settings &gt; Repository Setting 中的 Bitbucket URL。

    【讨论】:

    • 我做的唯一额外的事情是,在 VS 中,更改“Remotes” url 以匹配 Team Explorer > Home > Settings > Repository Settings 中的 bitbucket url
    • @TrevorDaniel 谢谢。我已将您的评论包含在答案中以提高知名度。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-09
    • 1970-01-01
    • 2017-09-22
    • 1970-01-01
    • 2018-11-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多