, replacing with the URL you copied in the previous step. 10 . Push your local repository to the remote repository by running the command git push -u origin master. After completing these steps, your existing project should be published to your new GitHub repository. You can continue to work on the project and use Git to commit and push changes to the remote repository." />

How do I add an existing Solution to GitHub from Visual Studio 2018?

Publishing an existing project to GitHub

 

To add an existing solution to GitHub from Visual Studio 2018, you can follow these steps:

 

  1. Open your solution in Visual Studio 2018.
  2. Open the Team Explorer window by clicking on the "Team Explorer" tab in the right-hand pane.
  3. Click on the "Manage Connections" button to open the "Connect" page.
  4. Click on the "Clone" button and enter the URL of the GitHub repository you want to add the solution to.
  5. Choose the location where you want to clone the repository and click the "Clone" button.
  6. Once the repository has been cloned, right-click on the solution in the Solution Explorer and select "Add Solution to Source Control".
  7. The "Add Solution to Source Control" dialog will appear. Choose Git as the source control provider and click the "Add" button.
  8. In the Team Explorer window, enter a commit message and click the "Commit All" button to commit the solution to the local repository.
  9. Click on the "Sync" button in the Team Explorer window to push the local changes to the GitHub repository.

 

After completing these steps, your existing solution should be added to the GitHub repository and you can continue to work on it from Visual Studio, committing and pushing changes as needed.

 

Publishing an existing project to GitHub?

 

To publish an existing project to GitHub, you can follow these steps:

 

1. Create a new repository on GitHub by clicking the "New repository" button on your GitHub dashboard.

 

2. Give your repository a name and, if you want, a description. Choose whether you want it to be public or private.

 

3. Click the "Create repository" button to create the new repository.

 

4. Open the command line or terminal on your local machine and navigate to the root directory of your project.

 

5. Initialize a new Git repository by running the command git init.

 

6. Add all files in your project to the Git repository by running the command git add ..

 

7. Commit the changes by running the command git commit -m "Initial commit".

 

8. Copy the HTTPS or SSH URL of your new GitHub repository.

 

9. Add the remote repository to your local Git repository by running the command git remote add origin <URL>, replacing <URL> with the URL you copied in the previous step.

 

10 . Push your local repository to the remote repository by running the command git push -u origin master.

 

After completing these steps, your existing project should be published to your new GitHub repository. You can continue to work on the project and use Git to commit and push changes to the remote repository.


Tags:

git

Share: