How to upload local project code on github

First you have to apply for an account on github

URL: https: //github.com/

Then you have to download a git tools

URL: https: //gitforwindows.org/

Enter the official website to download directly on the line, after entering the download is complete github page, click on the new project new repository, as shown below:

 

Then enter the following page, fill in a few major portion circled in red, as shown below:

 

Finally, click Create repository, generate the following page:

 

Red circle painted by step, first click Clone or download, and then copy the address of the second step, the project will be uploaded to be helpful.

The next step is a local operation, and before that you must take git installed, and then locate the folder you want to upload the project, right-click on the folder (note: not the menu files or archive) will be in option in

Git Gui Here, Git Bash Here appears, select Git Bash Here, there will be the following figure:

 

Then before you copy the clone or download in the figure below and paste the address, or manually enter:

 

Remember earlier address to add git clone.

Then your project file will increase a project name you created on github, as shown below:

 

Red circle draw up a folder meituan, is the new folder, then copy this directory you want to upload files to meituan folder.

Then git meituan command-line switch in the directory file, enter the command cd meituan enter, as shown below:

 

Then enter the command "git add." (Note. "" Can not be omitted, this is the new file folder meituan below or add in modified files,

If you have added some file before, it will automatically be omitted)

 

Then enter git commit "to submit information" (information submitted your project description) -m

(Note: git commit -m behind the increase representation can be entered directly commit, if not -m, direct input git commit, it will pop up a

Vim like interface, allows you to enter commit. )

Error occurs when submitting some user input just getting used, as shown below:

 

Then you have to Global Fortunately, the user name and mailbox git on, enter the command as shown below:

 

Then enter the command submitted as:

 

This fast upload was successful, and finally enter the command git push -u origin master (the purpose of this operation is to push the local repository to github above, this step requires you to enter account number and password to log on github)

 

Then enter in the github page, refresh the page will display your project, as shown below:

 

So that your project is successfully uploaded.

Guess you like

Origin www.cnblogs.com/zcpblog/p/11347192.html