一、在官网(http://git-scm.com/downloads)下载os版本,解压安装。也能够使用brew安装。html
二、添加sshkey前端
检查SSH keyhtml5
cd ~/.ssh
备份已有的key,(若是有的话)git
mkdir key_backup mv id_rsa* key_backup
生成SSH key程序员
$ ssh-keygen -t rsa -C your email Generating public/private rsa key pair. Enter file in which to save the key (/Users/username/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in yes. Your public key has been saved in id_rsa.pub. The key fingerprint is: SHA256:fCaDnNajwhFX6ypzvqLMQyJKSMiEo2Tl9/hgEb2WABo your mail The key's randomart image is: +---[RSA 2048]----+ |.E.o... . | |o++ ..o . | |Bo ..oo + | |oo .++X | |o .+*.S o | |+....ooo * | |+o = +. | |.o. .* | | +o .o. | +----[SHA256]-----+
将SSH key添加到GitHub
登陆到GitHub页面,Account Settings里面SSH Public Keys,Add another key 将生成的key(id_rsa.pub文件)内容copy到输入框中,save。github
测试连接shell
$ ssh git@github.com The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes PTY allocation request failed on channel 0 Hi jiang-bo! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.
别担忧,这是正常状况。bash
设置我的信息dom
$ git config --global user.name "username" $ git config --global user.email "your mail"
初始化:ssh
$ mkdir foldername $ cd foldername $ git init Initialized empty Git repository in /Users/xxx/.ssh/foldername/.git/
拉版本库:
$ git clone git@github.com:oisy/ideaBootstrapTemplate.git Cloning into 'ideaBootstrapTemplate'... Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts. remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (3/3), done. Checking connectivity... done.
而后提交推送
$git add . $git commit -m "blabla" $git push
好了,装git就是为了把这个貌美的前端模板传上去。
不知道是哪一个国家的程序员开发,模板上的文字都看不懂。可是功能很全,有单页面的简洁版,有多页面丰富版,有动画效果的页面滚动,有shop模式,有多种列表,多种控件,十分可爱。下载地址:
http://github.com/oisy/ideaBootstrapTemplate.git
截图感觉一下:
默认首页,还有更多html5的扁平化页面:
多种现成的页面可用:
丰富可爱的图标:
使人激动的组件:
商城列表:
附带记录bash command,删除整个目录和内容:
$cd xxx(subdir) $rm -rf -- dir