Exploring the use of Github in VS2017/2019

Mengxin records how to use github in VS2017/2019, don't spray it.

table of Contents

table of Contents

table of Contents

Problem solving methods and points of attention

text

Detailed exploration process

Try again

Finally try

to sum up:

A complete upload to Github steps

Explore what the colors in commits mean


Problem solving methods and points of attention

  • Push\upload\synchronization failed, just log in to the github account again here
Manage links
  • Github cloud repository Repos does not support Chinese 
The meaning of colors in github

text

Detailed exploration process

  • Create a new solution

Create a solution

 

  • You can see that the internal files of the solution are these:

Inside the solution folder

 

  • Open the sln file, because it is an empty project, so there is no file

sln file

 

  • Create a source file .cpp 

  • Ready to try github remote push my code

Right click on your solution and choose to add sln to the code manager

Knocking on the blackboard: I originally wanted to do remote push, I need a local library and a remote library

The local library can have a different name from the github remote library, just the connection relationship

Obviously, the local git library of the solution is inside the solution folder, which is very convenient

 

Created a local GIT repository, you need to upload it to Github
  • The local library is created

Take a look at what files the local Git library contains
  • Start trying to link github

Select View-Team Explorer
  •  First change my code

Change the source code and prepare to upload to Github
  • Enter the team explorer

Next to Solution Explorer, select Team Explorer

Choose to change, pay attention to the point of synchronization here, because synchronization will find github repos without this solution

Homepage of Team Explorer

The change is the Chinese name of a commit, which is to take a snapshot of the current code, and then push it to the commits of github. Obviously, there is a description of this commit

  • Pay attention to the branch here

Choose to change, pay attention to fill in your changed content or necessary information
  • Knock the blackboard: Commit is to save the local git library, and push is to upload to github.

Select-submit all and push, so you can upload github
You will be prompted to save the changes first

 

  • The prompt found that I did not log in github, so log in

If you have not logged in to your Github account, you will be prompted to log in to your Github account
My Github does not yet have a remote library, I need to create a remote Git library
  • Didn't find it, this solution has not yet established a cloud repository, that is, a github repository, let's build it now

Create a remote Git repository
  • github's repos does not support Chinese names

Fill in the basic information of the remote Git library

 

  • Outgoing submission is the commit that you submitted but has not been uploaded successfully

Outgoing submission: Pushes that have not been uploaded successfully will be displayed here
  • Show successful submission

Everything up-to-date
  • Check it out on github

Take a look at my remote Git repository
  • Obviously here are all the files,

  • The time on the right is the time of change. I changed the .cpp and uploaded the commit. Now I will upload another commit.

The remote library interface of this project in Github

 

Try again

  • Change code

Modify the source code
  • Necessary commit instructions

Fill in the necessary change instructions-submit all and push
Metaphysical network issues, you can check your Github account

Something went wrong, something went wrong, try syncing

Synchronization can reapply and submit for transmission, and can check whether the network is normal

 

 
  • Doesn't seem to work

 
Obviously I have a problem with the classic fashion network
 
 

 

  • Reason: Unable to read the username of " https://github.com ": Terminal prompts are disabled

  • Go to the homepage to sync and try

Check if the account connection is OK
 
 
  • Found it can be uploaded

I don't know how to do it
 

Finally try

  • Upload test3 commit
 
 
Upload
 
 
  • Upload test4 commit

Upload one more
 
 
Encounter problems
 
  • Upload another commit  

Test again
 
 
Found all OK
 
 
  • Come to github's repos library to see my commits

You're done

 

to sum up:

  • Push\upload\sync failed, just in
If it fails, come and see if the account link is OK
  • Log in to the github account again, and the problem can usually be solved

 

A complete upload to Github steps

(Learn how commit to see changes)

 

The first step-complete the modification of the current code

 

The second step-Team Explorer selects the change, fills in the change information, selects all submit and push

 

Push successfully

 

Go to the Github homepage to check the commits of this project

 

OK

 

 

Check the content of the change and complete the change without error

 

                                                                       You're done

 

Explore what the colors in commits mean

 

Change again

 

 

Push successfully

 

 

 

View

 

 

Select the commit just now

 

 

 

By comparison, red is the old code of the previous version, and green is the new code after modification.

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/Mrsherlock_/article/details/109546685