Git Visual Studio with Bitbucket confluence Connect to existing project error / Fetch fails

无人久伴 提交于 2019-12-21 23:14:17

问题


How do you pull from existing Bitbucket GIT repo using Visual Studio 17?

Error "git failed with a fatal error. 'xyz' repository not found "

  1. I added this Misty BitBucket Extension from the marketplace
  2. Then I added the Git remote string as below with three types of options and this help page.

First I tried this string -> https://<repo_owner>@bitbucket.org/<accountname>/<reponame>.git & https://<repo_owner>@bitbucket.org/<accountname>/<reponame> then I tried the URL path based on youtube videos & the over settings page https://bitbucket.org/myrepo/xos/src


  1. I get errors that the repo does not exist.

Would appreciate some help on how to setup/pull/fetch/sync code from Bitbucket.

Update 1: the error after adding the Clear Credentials Tool & extracting the SSH

Update 2: @Marina-Liu, even after hitting connect, bitbucket connection does NOT show in Visual Studio 2017


回答1:


If you are a user of the bitbucket repo, please make sure you have permission to clone the private repo. And then you can pull the bitbucket repo’s changes to the local existing repo.

  1. Login bitbucket.

    VS -> Manage connections -> login the bitbucket repo.

    And you can also clone a bitbucket repo directly after login.

  2. Add bitbucket repo as remote.

    In VS -> open your local repo -> in the right-bottom corner of VS -> it lists your repo folder name and branch name -> Team Explorer -> Settings -> Repository settings -> add remotes -> add a remote name (such as bit) -> input your bitbucket repo url (the format is https://bitbucket.org/account/reponame) -> save.

  3. Pull changes from bitbucket repo to the local existing repo.

    Fetch changes from bitbucket repo first:

    Team explorer -> Sync -> Fetch -> select the remote name you just added (such as bit) -> Fetch.

    If the local existing repo has not the origin remote, you can pull changes from bitbucket repo directly. If the local repo has other remote(s) except bit, you should merge bitbucket repo's changes into the local branch:

    Team explorer -> Branches -> Merge -> assume merge bit/master into master branch -> merge.


To clone the bitbucket repo by command line, you can follow below steps:

  1. Clear existing credential

    Credential Manager -> Windows Credentials -> remove all the credentials about bitbucket.org

  2. Clone by command line

    Now you can clone the butbucket repo by command git clone https://bitbucket.org/account/reponame directly, it will let you to input your email address and password.




回答2:


You would need https://bitbucket.org/<user>/<repo>, without the final /src.

And make sure it is not a private repo, or that you are its owner, or you would not be able to access it.



来源:https://stackoverflow.com/questions/48334670/git-visual-studio-with-bitbucket-confluence-connect-to-existing-project-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!