Teach you how to upload projects to GitHub

Preface: how GitHub can not use it as a developer, I have just done some research on how to upload GitHub project, watch this blog for beginners, please pass chiefs.

New GitHub repository

Not registered to go to the GitHub official website registration, after registration, follow these steps to create a new GitHub repository.

I go to the warehouse, click the New button to create a new warehouse

Click Create entered the warehouse after warehouse name

After you create a successful entry to the following page, copy down arrow refers to the address.

Install Git

If you had not installed the Git click on the link to install Git , had already installed you can skip to the next step, there are no special requirements direct the next step in the installation process on it.

Upload project

The first step: First down project, there are two ways to lower the project

Git Bash 1. click on the taskbar

After cd to your next project, I wasf:/githubup

2. Direct find items and then rightGit Bash Here

Step two: By git initcommand this project can become a Git repository management

Then we can find more than a project under the .gitfile directory, which is used to track and manage Git repository, all right, do not manually modify the file or folder, or change the mess, put the Git repository to destroy.

The third step: Use git addcommand tells Git, add files to the warehouse project

No response, no reaction is any sign of success. Why add back is .it, .means that all files in the project are added to the repository, we can also add a separate document, write directly on a separate file name on it in the back add, of course, we can addmany times.

Step 4: git commitcommand tells Git, the submission of documents to the repository

-m后面输入的是本次提交的说明,可以输入任意内容,当然最好是有意义的,这样你就能从历史记录里方便地找到改动记录。

嫌麻烦不想输入-m "xxx"行不行?确实有办法可以这么干,但是强烈不建议你这么干,因为输入说明对自己对别人阅读都很重要。

git commit命令执行成功后会告诉你,1 file changed:1个文件被改动(我们新添加的readme.txt文件);1 insertions:插入了1行内容(test.txt有两行内容)。

如果出现以下内容则需要输入自己的账号和邮箱,当然我已经不用输入这些了,所以这张图是我网上找来的。

按照上面给的代码输入naneemail后再次执行git commit命令。

第五步:输入git remote add origin 自己仓库地址将本地仓库关联到GitHub上,然后输入git push -u origin master将代码上传到GitHub上。

执行完后,如果没有异常,会等待几秒,然后跳出一个让你输入Username和Password 的窗口,你只要输人github的登录账号和密码就行了,好了上你的GitHub上看看项目有没有传上去吧。

Guess you like

Origin www.cnblogs.com/zouwangblog/p/11201561.html