Answer a question

I have a project that I have started in visual studio and would like to add it to an existing GitHub repository. I am using visual studio 17 and I have installed the github extension for visual studio. I have synced the repo with visual studio and the added the project to source control. There is the option to publish to GitHub but looks like it creates a new repository. Is there any way to add a project to an existing GitHub repository?

Answers

I'm not familiar with VS git...but in CLI git, you should be able to run git remote add origin <path to github repo>. Whenever you push and pull, it will impact that repository

If this is a more carefully managed repo and code is merged via pull requests, you would want to create your own github repo as VS is doing, and then add the original repository as upstream. Basically the same thing: git remote add upstream <path to organization's repo>

If you don't see a way to add upstream or run command line from visual studio plugin, you'll have to download the git command line tools https://git-scm.com/download/win. If it's installed correctly, you should be able to run git and see a bunch of usage instructions come up. If your project is already a git repo, the top of that project directory should have a .git folder. You can run the commands I listed from anywhere within that project directory

Logo

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!

更多推荐