hello world,github

  • china
  • american
    array_column('',$atrr);
    print($a);
    

参考资料整理

  • 图形直观的:http://ndpsoftware.com/git-cheatsheet.html
  • 官方doc:https://git-scm.com/doc
    • 里面有很多参考资料的连接
    • 图形:http://justinhileman.info/article/git-pretty/git-pretty.png
  • 国内博客https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137402760310626208b4f695940a49e5348b689d095fc000
  • 官方book: https://git-scm.com/book/zh/v2

重点内容

  • 帮助 git log --help or git help log
  • 配置git : git config,按照影响范围分三层
    • system层,针对所有用户配置。例如git config --system log.date iso,可在/etc/gitconfig中看到
    • global层,针对当前用户。git config --global log.date iso,可在~/.gitconfig中看到与改写
    • local层,default ,针对当前repository。git config log.date iso ,可在当前资源库的.git/config看到与改写
  • 分支的创建与合并
    • 官方简单而清晰的demo例子
    • git branch test 创建test分支
    • git checkout -b test 创建test分支并切换到此分支`
    • git checkout test切换分支到test
    • git branch --list or git branch 列出所有分支
  • 合并
    • git merge hot_fix,将hot_fix分支合并到当前分支
    • 有冲突时,运用工具软件合并 Use vimdiff as git mergetool - Ruslan Osipov
  • Log 日志
    • https://git-scm.com/docs/git-log/1.7.12.2
    • https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E6%9F%A5%E7%9C%8B%E6%8F%90%E4%BA%A4%E5%8E%86%E5%8F%B2
    • 最新 的几次log 提交
      • log 本身就是按照从新至旧的顺序展示的。限制条数可以直接-3,就是显示最近3条
    • 怎么按照某人+时间段查询
      • 按照作者+时间段查询 : git log --author='kaisa316' --since='2018-08-15 00:00:00' --until='2018--9-26'
      • 显示log中的文件: git log --name-only or git log name-status
      • merge 之后,log中没有显示文件了。可以通过-m参数解决
    • 时间格式怎么本地化
      • git log.date --global iso ,格式类似 Date: 2018-01-07 22:03:43 -0500
      • git config --global log.date format:'%Y-%m-%d %H:%M:%S'
      • git log --date=format:'%Y-%m-%d %H:%M:%S'
    • –stat 统计
    • -Syy 仅显示添加或删除yy关键字的记录
  • 回撤(恢复到历史某个版本) - git checkout -- xxx.php, 本地修改了,但还没有放到index暂存区,用checkout - git reset commit_id ,workspace 本地中的文件不会被更新,index会被更新。 - git reset --hard commit_id , workspace 和index都会被更新成commit_id的内容
  • diff ,文件不同对比
    • 默认git diff是有个简单的文本比较,但不太方便。
    • git difftool,这个可以使用vimdiff,推荐。可以通过使用别名,git config –global alias.df difftool进行简化.
    • diff可以指定commit号进行比较, for example:git df 111b9d9 d112da3 .vimrc
    • Difference between git HEAD and the current project state? - Stack Overflow
  • 暂存(stash)
  • 忽略特殊文件

远程支持

  • create a new repository on the command line

echo “# lumen_demo” » README.md git init git add README.md git commit -m “first commit” git remote add origin https://github.com/kaisa316/lumen_demo.git git push -u origin master

  • push an existing repository from the command line git remote add origin https://github.com/kaisa316/lumen_demo.git git push -u origin master

Here be a sample post with a custom background image. To utilize this “feature” just add the following YAML to a post’s front matter.

image:
  background: filename.png

This little bit of YAML makes the assumption that your background image asset is in the /images folder. If you place it somewhere else or are hotlinking from the web, just include the full http(s):// URL. Either way you should have a background image that is tiled.

If you want to set a background image for the entire site just add background: filename.png to your _config.yml and BOOM — background images on every page!

Background images from Subtle Patterns (Subtle Patterns) / CC BY-SA 3.0
Syntax Highlighting Post

Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.1

GFM Code Blocks

GitHub Flavored Markdown fenced code blocks are supported. To modify styling and highlight colors edit /_sass/syntax.scss.

#container {
  float: left;
  margin: 0 -240px 0 0;
  width: 100%;
}
.highlight {
  margin: 0;
  padding: 1em;
  font-family: $monospace;
  font-size: $type-size-7;
  line-height: 1.8;
}
<nav class="pagination" role="navigation">
  {% if page.previous %}
    <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
  {% endif %}
  {% if page.next %}
    <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
  {% endif %}
</nav><!-- /.pagination -->
1
2
3
4
5
6
7
8
<nav class="pagination" role="navigation">
  {% if page.previous %}
    <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
  {% endif %}
  {% if page.next %}
    <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
  {% endif %}
</nav><!-- /.pagination -->
module Jekyll
  class TagIndex < Page
    def initialize(site, base, dir, tag)
      @site = site
      @base = base
      @dir = dir
      @name = 'index.html'
      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
      self.data['tag'] = tag
      tag_title_prefix = site.config['tag_title_prefix'] || 'Tagged: '
      tag_title_suffix = site.config['tag_title_suffix'] || '&#8211;'
      self.data['title'] = "#{tag_title_prefix}#{tag}"
      self.data['description'] = "An archive of posts tagged #{tag}."
    end
  end
end

Code Blocks in Lists

Indentation matters. Be sure the indent of the code block aligns with the first non-space character after the list item marker (e.g., 1.). Usually this will mean indenting 3 spaces instead of 4.

  1. Do step 1.
  2. Now do this:

    def print_hi(name)
      puts "Hi, #{name}"
    end
    print_hi('Tom')
    #=> prints 'Hi, Tom' to STDOUT.
    
  3. Now you can do this.

GitHub Gist Embed

An example of a Gist embed below.

Sample Link Post

This theme supports link posts, made famous by John Gruber. To use, just add link: http://url-you-want-linked to the post’s YAML front matter and you’re done.