Since I have seen a lot of technical books at the same time, there are a lot of examples in the book that I would like to try out for myself, but it's too much trouble to create a new project every time I write an example, just sort of a collection and post it on GitHub.
- First use GitHub for Windows, click on the [+] sign in the upper left corner, the default option is [Create], select a directory, and fill in the [Name] text box with the project name,
- After the GIT project is created, select [Publish Repository] in the upper-right corner to write the description of the project [Description], then click on the [Publish] button below to post to GitHub
- So in the list on the left, you can see that the GIT project we just created has risen from the local group to the GitHub group, and can open the GitHub page of this project by right-clicking [View on GitHub]
After the GIT project is created and uploaded to GitHub, the next step is to create a Visual Studio project. The structure of the project according to personal preferences, you can put all the book's source code into a solution, you can also have a solution containing all the code of the book, here choose the latter.
- Select the GIT project directory, then select the project language and type, and remove the [Create directory for solution] Check in the lower right corner to create a vs project directly at the root of the GIT project
- Once created (I created a sample project of two books myself), I can see that the [+] sign in the [solution Explorer] in VS is in front of the file directory, indicating that git has been identified
- The next step is to commit the project changes, which are presented in two ways, either through Vs's own [Team Explorer] or through GitHub for Windows, which is recommended.
- Click the right mouse button on the solution node and select [Commit ...] Submit Options
- Automatically jumps to the [Team Explorer] window, which must be filled in in the middle of the text box to click the button below
- On the right side of the button, there is a drop-down arrow, select [Commit and push], submit the changed content and push it to GitHub
- If vs is not connected to GitHub, a window will pop up and you'll need to enter GitHub's username and password, because I've entered it before, so this window won't pop up and take a screenshot.
- After submission and push is complete, you can see the relative commit history in GitHub for Windows.
- You can see that the project file was successfully submitted on GitHub
Deploy a Visual Studio project using GitHub for Windows