Visual Studio: How to create project from existing GitHub repository?

前端 未结 3 1816
予麋鹿
予麋鹿 2021-01-31 02:01

I came from Eclipse background and I am apparently missing something.

There is an existing GitHub project with JS code in it and I would like to start adding TypeScript

3条回答
  •  日久生厌
    2021-01-31 02:49

    Do you have any code in that repository yet that you want to open? I'm guessing not in which case you need to create a new VS project (just like you'd create a new Eclipse project and have it in your workspace)

    Go to File, New..., Project... and pick the project type that you want. Give the project a name and set the location to be a folder INSIDE the folder that you cloned your Git repo to earlier (i.e. c:\mycode\mygitproject). Also give your solution a name. A "Solution" in Visual Studio is a wrapper for the projects inside it, kinda like the closest thing to a workspace or a working set in Eclipse but not quite the same thing.

    Then Visual Studio should then be smart enough to pick up that this is in Git repo and allow you to commit locally as well as push/pull to GitHub etc.

    Finally, while I work with the team that created the Visual Studio Tools for Git, I'd still highly recommend that you get hold of a command line should you want to do some more powerful stuff with Git other than simply committing code, push/pulling changes and branching or merging branches. If you are working against GitHub then you might also want to install GitHub for Windows which will bring some Git tools with it or you can install Git for Windows and also install Posh-Git separately. All of these things work together and give you the maximum power of Git but you can pick and choose the tool that works best for you. You'll probably find a workflow of Clone using GitHub for Windows, commit/push/pull/branch/merge in VS and then Posh-Git if you do more advanced stuff or want to hand-tweak settings.

提交回复
热议问题