Git basic use 1: Submit code to remote warehouse for the first time

[1] Initialize the local code and submit it to the remote

              Create a warehouse, which can be in code cloud or github, here we take github as an example.

The warehouse address is: GitHub - LeoLiang23/PagingDemo: Android-JetPack-Paging

Then, in your own project directory, right-click-Git Bash Here

Enter git init in the Git command window to initialize the local warehouse. After the initialization is complete, a .git folder will appear in the local warehouse folder, proving that the warehouse has been managed by git;

Then, submit the file to the cache,

git add * (commit all files) or git add app (only submit app folder), submit all files here

after that:

git commit -m "first submission code"   submits the code to the local warehouse

after that:

git remote add origin https://github.com/LeoLiang23/PagingDemo.git     

Then set the remote branch address, set the name here: origin, you can set the remote name according to your own needs, but the naming convention must be

after that:

git push -u origin master: push the code to the remote warehouse

In this way, the code is pushed to the remote warehouse.

Guess you like

Origin blog.csdn.net/Leo_Liang_jie/article/details/109486742