作者:过客烤翅加盟889 | 来源:互联网 | 2023-09-12 13:58
安装git1、在官网(http:git-scm.comdownloads)下载os版本,解压安装。也可以使用brew安装。2、添加sshkey检查SSHkeycd~.ssh备份已有
安装 git
1、在官网(http://git-scm.com/downloads)下载os版本,解压安装。也可以使用brew安装。
2、添加sshkey
检查SSH key
cd ~/.ssh
备份已有的key,(如果有的话)
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。
测试链接
$ 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.
别担心,这是正常情况。
设置个人信息
$ git config --global user.name "username"
$ git config --global user.email "your mail"
使用 git
初始化:
$ 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