(1) Register your github account and install local git
Sign Up will let you choose your code hosting is private and public, private is paid, only individuals can see;
(2) Create a new warehouse on GitHub, fill in the description of your warehouse name (TEST2) and warehouse, and initialize the repository and a readme (after initialization, follow the instructions to update the latest repository)
(3) Create a local folder where the code is stored
(4) Open git brash, pwd command to view the current directory
CD D:CD gitworkspaces CD Test2 jump to the same directory as the local repository
Execute the GIT init command (turn this directory into a directory that git can manage)
You will see one more. git file under the current directory
(5) Create an SSH key locally (that is, the public key)
$ ssh-keygen-t rsa-c "[email protected]" all the way to the carriage return, and finally the. ssh file is generated under the directory.
Password for the public key, create a new public key on GitHub and paste the password up.
(6) Upload the local repository to GitHub
git remote Add the repository's HTTPS above the Origin +github, which can then be viewed via git remote (for ease of administration, GIT requires that each remote host must specify a host name.) git remote
command is used to manage host names. )
(7) Optional steps (in step 2 if you initialize the repository and a readme, you need to follow the new local repository before uploading)
by using the Git Pull--rebase Origin master command to update, you will find that your Test2 directory has one more file (the function of the git pull command is to retrieve the update from a branch of the remote host, and then the local Consolidated)
(8) Create a new file in the local directory and then
git add re.txt (add)
Git commit-m "Sencond" to create a new (commit) in Git
At last
Git push-u origin master uploads to GitHub, and you'll see that GitHub has the same content as your Test2 folder! (Used to push updates to the local branch to the remote host)
Finally, take a look at the command line I knocked. !
teach you how to upload files on GitHub