Git project from local upload to Github
1. Create a local repository
We need to create a local repository
2. Git to take over the local repository
In the project folder in the right , choose Git Bash , will pop up a command line interface ,
Enter the command git init
this folder becomes Git can manage warehouse
3. The project file is added to the buffer zone
Enter the command git add .
to paste all the files in the project to the local Git repository inside
input commands git status
can view the current status
4. submit project
Enter the command git commit -m "first commit"
to submit items to the warehouse
5. conduct github website and SSH
Since local Git repository and Github warehouse transmission between the through SSH encrypted , so the need to set up the connection:
KEY create SSH . First, check whether the presence of the C drive user directory ssh directory , there are not any, look id_rsa and id_rsa.pub these two documents, if it is the next step, not to enter the command to create:
$ ssh-keygen -t rsa -C "[email protected]"
登录 https://github.com/ ,点击右上角的图标,找到Settings,再选中SSH and GPG KEYS,点击New SSH key,Title随便填,把id_rsa.pub里面的内容复制到Title下面的Key内容框里面,最后点击Add SSH key。
6. Github上创建仓库
在Github上任意创建一个Git仓库
7. 关联本地仓库
在Github上创建好Git仓库之后我们就可以和本地仓库进行关联了,根据创建好的Git仓库页面的提示,可以在本地GitHubTest仓库的命令行输入,例如:
$ git remote add origin https://github.com/Joues/-.git
8. 推送项目
输入命令:$ git push -u origin master
图片如上。
9. 完成
刷新github个人网页即可看到项目信息。