Initialize the local warehouse
Enter the project address and initialize the project into a git local warehouse through the command git init
Execution: The git init
command initializes the local code repository,
displays the hidden folder. Git succeeds
Add all files in the project to the staging area
Execute: git add .
add all files in the project to the temporary storage area,
there will be no output, wait for the next input, which is successful
Submit the modified content stored in the temporary storage area to the local warehouse
git commit
Command will be git add .
stored in the temporary storage area to modify the content presented to the local repository, if the file is not added to the staging area, not to commit any changes when it is submitted.
git commit -m 'xxx'
// xxx is the name of Notes Notes must be written
Create a new warehouse on github, copy the warehouse address, and then use the command to establish a connection between the local warehouse and the remote warehouse
-
①
git remote add origin xxx
//xxx is the address of the git warehouse- Use HTTPS address for submission this time
-
② An error may appear in this step, indicating fatal: remote origin already exists
-
③ Execution:
git remote rm origin
Command -
Then execute the order of ①
Push the code in the staging area to the remote warehouse
git push -u origin master
At this point, the Git local code is uploaded to the remote warehouse to complete