· GIThub Profile
· Own account and understand GIThub
The first step registration
Enter https://github.com , then sign up for an account
The second step to ensure the freedom to create / modify / download / upload a library (repository)
Web page is a lot of html, css, js and other files, and to github pages, it is a repository to store these files in the folder, so make sure you can manage an arbitrary library is essential. Here is the first official tutorial: GitHub: the Hello world . Construction and maintenance can be understood through a library of buttons, but only allows you to modify create a Readme file.
Here you will realize that each library can create a branch (branch), the actual operation, if the version requirements are less stringent (be it web page), you can ignore the existence of the branch, only to master a default branch .
This time you can already see the page with such a library, and this figure is my own blog libraries, and to this point you should have only one library Readme:
The key is that you can use Git Github to control ( Wikipedia -git ), which is a version of the tool (My understanding is that every time a backup will upload a version, and can be coordinated simultaneously modified more than a public network disk). When the own terminal can be determined using the git --version
following command (Mac + Xcode own), and the installation of SSH-Key, you can use the following basic commands to control your library of:
git clone 你的SSH地址 (下载你的reposity,这个地址可以用网页浏览的Clone-or-Download-use SSH按钮看到,比如说git@github.com:uername/reposity.git) git pull (联系服务器,更新本地文件夹) git add --all (写入本地的所有新文件) git commit -am "随便说点啥" (在本地进行一次有记录地更新,包括本地所有文件的修改) git push origin master (把本地的更新推送到服务器)
SSH-Key决定了你的电脑有没有权限进行这些操作,这里有另一个官方教程:GitHub:SSH,这个是必须一步步跟下来的,Mac的重要命令包括:
ls -al ~/.ssh (查一下是不是已经有key了)
ssh-keygen -t rsa -b 4096 -C "[email protected]" (产生一个key,不单独设密码的话一路回车就行)
pbcopy < ~/.ssh/id_rsa.pub (把你的key复制到粘贴板,不这么复制可能太长了复制不下来)
Linux和Windows进入刚才的教程看就行,如下图,在点击“右上头像”+“Settings”+“SSH and GPG Keys” 这里添加了你刚刚复制的public Key之后,你就有权限进行上述的Git操作了。