سؤال

How to move an existing project from GitHub to Visual Studio Online, AND keep all changes history ? And (if possible) avoiding command prompt. :$

Actually I tried with command prompt given from a blog post, but failed. (git remote add https:github.com/xxx/xxx/xxx.git, and it says : set up remote as a mirror to push or fetch from.)

(Incidentally, would it be possible to have the same project synchronised on GitHub AND visual studio online ?)

Thanks.

هل كانت مفيدة؟

المحلول

Yes, it's a git repo. Git pulls the full repo locally and you can push it to another remote.

A git repo can have multiple remotes. See ref on remotes here.

In vsonline, log in, create a new project, select git as the source control. go to the code hub. It will give you instructions for pushing an existing repo (that you cloned from github). If you have an existing vsonline, project, you can add existing repos by going to the admin area (gear upper right, version control tab).

Something like (proj == repo):

https://{acctname}.visualstudio.com/DefaultCollection/_git/{projname}

If it's another repo in the same project it will be something like:

https://{acctname}.visualstudio.com/DefaultCollection/{projname}/_git/{reponame}

Now, you can add a remote for you existing repo:

git remote add vsonline {urlHere}

Now, you can push the repo to vsonline using git push {remoteName} {branch}

git push vsonline master

Now you have a repo with multiple remotes. You can delete the remotes or keep pushing changes to both.

If vsonline will be your only remote, convention is to call it origin (primary remote)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top