About GIThub the basis of applications

· GIThub Profile

As open source code base and version control system, Github has more than 9 million developers users. As more and more applications into the cloud, Github has become the preferred method for managing software development and find existing code. As described above, as a distributed version control system, there is not only a main library in Git, every copy the library can be used independently, any inconsistencies between the two libraries may be merger.
 
GitHub hosts git repository, and provides a web interface, but with foreign SourceForge , Google Code or China's coding of different services, GitHub's unique selling point is the easy branching from another project. For a project to contribute code is very simple: First, click on the project site of the "fork" button, and then modify the code detected and added to your forked codebase, ultimately responsible to the project through the built-in "pull request" mechanism people proposing a merge. GitHub has already been referred to the Code of players MySpace.
 
Branch as in the GitHub Myspace (or Facebook Like ...) were friends, constantly in the node in the social graph connections. Itself is hosted on GitHub GitHub project is also natural, but in a private and some public view is not visible in the library. Open source projects are hosted for free, but private library is not so. Chris Wanstrath, one of GitHub developers, affirmed the free library to support financially by paying private library hosting this program.
 
Through contact with customers, develop FamSpam, even developing GitHub itself, GitHub's private library has been proven value for money. Any hope and want to save time and, like other members of the team away from the page as the bitter person will get the value of what they really want from GitHub in.
 

· 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:

 
Github Pages in a library

 

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 --versionfollowing 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操作了。

 
在这里添加id_rsa.pub里面的内容
 

·搭建Github Page网站

第一步 创建一个Github Pages repository

GitHub Pages repository跟普通的repository是一样的,唯一的区别就是他的名字必须叫做username.gihub.io。这个官方教程 GitHub Pages 写的十分好懂,按这个做完之后你就有了一个你的网址 username.github.io,里面有一句 Hello World!

第二步 最基础的网站框架

现在离一个好网站只差一步了,就是把某个好网站的所有文件拷贝到你的库里面。GitHub官方建议你使用博客生成工具 Jekyll 。GitHub在库的设置里面还提供Jekyll主题选择。而我的博客使用了Hexo生成工具,具体见我的博客Github Pages(三):使用Hexo博客生成工具

 

 

强烈推荐使用网站工具,这样可以直接用markdown格式编辑文章,而且使用简单的命令实现预览,生成和发布,从而节省大量的时间。

我一开始并不了解博客工具,所以去了一个模版网站 HTML5 UP,然后下载了其中一个模版,直接在本地打开 index.html,就看到了网站预览,如图:

 
一个朴素的网站模板

 

然后再手动git add 所有的文件到我的网站中。当你git push之后,你的域名就会变成这样一个网站了。这也就是一个最基础的网站了。
不用博客工具的好处是有利于学习网页知识,当博客不多的时候,对习惯使用bash+vim的人来说,这样编辑网站是可以接受的。坏处是写一个博客就多一个html,如果有比如超过50篇博客,每篇博客的公共部分就很麻烦了。

 
 
 

Guess you like

Origin www.cnblogs.com/ts2254/p/11563748.html