-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
281 lines (180 loc) · 14.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CGT's blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="前端博客">
<meta property="og:type" content="website">
<meta property="og:title" content="CGT's blog">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="CGT's blog">
<meta property="og:description" content="前端博客">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CGT's blog">
<meta name="twitter:description" content="前端博客">
<link rel="alternate" href="/atom.xml" title="CGT's blog" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="container">
<div id="wrap">
<header id="header">
<div id="banner"></div>
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<h1 id="logo-wrap">
<a href="/" id="logo">CGT's blog</a>
</h1>
<h2 id="subtitle-wrap">
<a href="/" id="subtitle">一只前端小菜鸟的成长日记</a>
</h2>
</div>
<div id="header-inner" class="inner">
<nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"></a>
<a class="main-nav-link" href="/">Home</a>
<a class="main-nav-link" href="/archives">Archives</a>
</nav>
<nav id="sub-nav">
<a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
<a id="nav-search-btn" class="nav-icon" title="搜索"></a>
</nav>
<div id="search-form-wrap">
<form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit"></button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
</div>
</div>
</div>
</header>
<div class="outer">
<section id="main">
<article id="post-Git-使用小结" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/12/25/Git-使用小结/" class="article-date">
<time datetime="2017-12-25T15:39:29.000Z" itemprop="datePublished">2017-12-25</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/12/25/Git-使用小结/">Git 使用小结</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="git安装完成后-还需要最后一步设置-在命令行输入"><a href="#git安装完成后-还需要最后一步设置-在命令行输入" class="headerlink" title="git安装完成后,还需要最后一步设置,在命令行输入:"></a>git安装完成后,还需要最后一步设置,在命令行输入:</h3><blockquote>
<p>git config –global user.name ‘yourname’<br>git config –global user.email ‘[email protected]’</p>
</blockquote>
<h3 id="1-初始化一个Git仓库,使用-git-init-命令。"><a href="#1-初始化一个Git仓库,使用-git-init-命令。" class="headerlink" title="1. 初始化一个Git仓库,使用 git init 命令。"></a>1. 初始化一个Git仓库,使用 git init 命令。</h3><h3 id="2-添加文件到Git仓库,分两步:"><a href="#2-添加文件到Git仓库,分两步:" class="headerlink" title="2. 添加文件到Git仓库,分两步:"></a>2. 添加文件到Git仓库,分两步:</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">第一步,使用命令 git add <file> ,注意,可反复多次使用,添加多个文件;</span><br><span class="line">第二步,使用命令 git commit ,完成。</span><br></pre></td></tr></table></figure>
<h3 id="3-要随时掌握工作区的状态,使用-git-status-命令。"><a href="#3-要随时掌握工作区的状态,使用-git-status-命令。" class="headerlink" title="3. 要随时掌握工作区的状态,使用 git status 命令。"></a>3. 要随时掌握工作区的状态,使用 git status 命令。</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">如果 git status 告诉你有文件被修改过,用 git diff <file>可以查看修改内容。</span><br></pre></td></tr></table></figure>
<h3 id="4-HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git-reset-–hard-commit-id。"><a href="#4-HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git-reset-–hard-commit-id。" class="headerlink" title="4. HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git reset –hard commit_id。"></a>4. HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git reset –hard commit_id。</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">穿梭前,用git log可以查看提交历史,以便确定要回退到哪个版本。</span><br><span class="line">要重返未来,用git reflog查看命令历史,以便确定要回到未来的哪个版本。</span><br></pre></td></tr></table></figure>
<h3 id="5-修改后可用命令来查看工作区和版本库文件的区别"><a href="#5-修改后可用命令来查看工作区和版本库文件的区别" class="headerlink" title="5. 修改后可用命令来查看工作区和版本库文件的区别:"></a>5. 修改后可用命令来查看工作区和版本库文件的区别:</h3><blockquote>
<p>git diff readme.txt<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">用命令git checkout -- readme.txt 可以丢弃工作区的修改(修改后 未add的)</span><br><span class="line">用命令git reset HEAD readme.txt可以把暂存区的修改撤销掉(unstage),重新放回工作区:</span><br><span class="line">git reset命令既可以回退版本,也可以把暂存区的修改回退到工作区。当我们用HEAD时,表示最新的版本。</span><br></pre></td></tr></table></figure></p>
</blockquote>
<h3 id="6-远程仓库"><a href="#6-远程仓库" class="headerlink" title="6. 远程仓库"></a>6. 远程仓库</h3><p>创建SSH Key :</p>
<blockquote>
<p>ssh-keygen -t rsa -C ‘[email protected]’<br>查看public key,并把它添加到码云的 SSH公钥 :<br>cat ~/.ssh/id_rsa.pub</p>
</blockquote>
<h3 id="7-要关联一个远程库,使用命令git-remote-add-origin-git-server-name-path-repo-name-git;"><a href="#7-要关联一个远程库,使用命令git-remote-add-origin-git-server-name-path-repo-name-git;" class="headerlink" title="7.要关联一个远程库,使用命令git remote add origin git@server-name:path/repo-name.git;"></a>7.要关联一个远程库,使用命令git remote add origin git@server-name:path/repo-name.git;</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">推送之前要拉取远程仓库源文件 git pull --rebase origin master 方可</span><br><span class="line">关联后,使用命令 git push -u origin master 第一次推送master分支的所有内容;</span><br><span class="line">此后,每次本地提交后,只要有必要,就可以使用命令git push origin master推送最新修改;</span><br></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2017/12/25/Git-使用小结/" data-id="cjbmdr64v0001t8gctgi1k9pd" class="article-share-link">Share</a>
</footer>
</div>
</article>
<article id="post-Christmas-Day" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/12/25/Christmas-Day/" class="article-date">
<time datetime="2017-12-25T14:54:30.000Z" itemprop="datePublished">2017-12-25</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/12/25/Christmas-Day/">Christmas Day</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="圣诞节来临,新的一年将至"><a href="#圣诞节来临,新的一年将至" class="headerlink" title="圣诞节来临,新的一年将至"></a>圣诞节来临,新的一年将至</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">奋斗就是每一天都很难,可一年比一年容易。不奋斗就是每一天都很容易,可一年比一年越难。</span><br></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2017/12/25/Christmas-Day/" data-id="cjbmdr64k0000t8gcbca2e1yc" class="article-share-link">Share</a>
</footer>
</div>
</article>
<article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/11/21/hello-world/" class="article-date">
<time datetime="2017-11-21T13:49:32.697Z" itemprop="datePublished">2017-11-21</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/11/21/hello-world/">Hello World</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="noopener">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="noopener">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="noopener">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="noopener">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="noopener">Deployment</a></p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2017/11/21/hello-world/" data-id="cjbmdr6510002t8gc3x9chpis" class="article-share-link">Share</a>
</footer>
</div>
</article>
</section>
<aside id="sidebar">
<div class="widget-wrap">
<h3 class="widget-title">归档</h3>
<div class="widget">
<ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">十二月 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/">十一月 2017</a></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">最新文章</h3>
<div class="widget">
<ul>
<li>
<a href="/2017/12/25/Git-使用小结/">Git 使用小结</a>
</li>
<li>
<a href="/2017/12/25/Christmas-Day/">Christmas Day</a>
</li>
<li>
<a href="/2017/11/21/hello-world/">Hello World</a>
</li>
</ul>
</div>
</div>
</aside>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
© 2017 Chen Guotian<br>
Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
</div>
</div>
</footer>
</div>
<nav id="mobile-nav">
<a href="/" class="mobile-nav-link">Home</a>
<a href="/archives" class="mobile-nav-link">Archives</a>
</nav>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script src="/js/script.js"></script>
</div>
</body>
</html>