literate-dotfiles/docs/git.html

534 lines
24 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-01-11 sam. 22:19 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Git Configuration</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Git Configuration</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org41626fa">Gitconfig</a>
<ul>
<li><a href="#org9dadb2d">Aliases</a></li>
<li><a href="#org9891923">Apply</a></li>
<li><a href="#org3d3c60c">Colors</a></li>
<li><a href="#org005e9ea">Default Remote</a></li>
<li><a href="#org27b5c46">Push Configuration</a></li>
<li><a href="#org8e4fe7a">User</a></li>
<li><a href="#org437daae">Core configuration</a></li>
<li><a href="#org39b3cb9">Credentials using pass</a></li>
<li><a href="#org02367c3">Diff-so-fancy</a></li>
<li><a href="#org599c398">Github</a></li>
</ul>
</li>
<li><a href="#org3e19276">Global Git Ignore</a></li>
</ul>
</div>
</div>
<div id="outline-container-org41626fa" class="outline-2">
<h2 id="org41626fa">Gitconfig</h2>
<div class="outline-text-2" id="text-org41626fa">
</div>
<div id="outline-container-org9dadb2d" class="outline-3">
<h3 id="org9dadb2d">Aliases</h3>
<div class="outline-text-3" id="text-org9dadb2d">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">alias</span>]
<span class="org-comment-delimiter"># </span><span class="org-comment">View abbreviated SHA, description, and history graph of the latest 20 commits</span>
<span class="org-variable-name">l</span> = log --pretty=oneline -n <span class="org-highlight-numbers-number">20</span> --graph --abbrev-commit
<span class="org-comment-delimiter"># </span><span class="org-comment">View the current working tree status using the short format</span>
<span class="org-variable-name">s</span> = status -s
<span class="org-comment-delimiter"># </span><span class="org-comment">Show the diff between the latest commit and the current state</span>
<span class="org-variable-name">d</span> = !<span class="org-string">"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"</span>
<span class="org-variable-name">di</span> = diff --cached --ignore-all-space
<span class="org-comment-delimiter"># </span><span class="org-comment">Pull in remote changes for the current repository and all its submodules</span>
<span class="org-variable-name">p</span> = !<span class="org-string">"git pull; git submodule foreach git pull origin master"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Clone a repository including all submodules</span>
<span class="org-variable-name">c</span> = clone --recursive
<span class="org-comment-delimiter"># </span><span class="org-comment">Commit all changes</span>
<span class="org-variable-name">ca</span> = !git add -A &amp;&amp; git commit -av
<span class="org-comment-delimiter"># </span><span class="org-comment">Switch to a branch, creating it if necessary</span>
<span class="org-variable-name">go</span> = <span class="org-string">"!f() { git checkout -b \"$1\" 2&gt; /dev/null || git checkout \"$1\"; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Show verbose output about tags, branches or remotes</span>
<span class="org-variable-name">tags</span> = tag -l
<span class="org-variable-name">branches</span> = branch -a
<span class="org-variable-name">remotes</span> = remote -v
<span class="org-comment-delimiter"># </span><span class="org-comment">Amend the currently staged files to the latest commit</span>
<span class="org-variable-name">amend</span> = commit --amend --reuse-message=HEAD
<span class="org-comment-delimiter"># </span><span class="org-comment">Credit an author on the latest commit</span>
<span class="org-variable-name">credit</span> = <span class="org-string">"!f() { git commit --amend --author \"$1 &lt;$2&gt;\" -C HEAD; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Interactive rebase with the given number of latest commits</span>
<span class="org-variable-name">reb</span> = <span class="org-string">"!r() { git rebase -i HEAD~$1; }; r"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Remove the old tag with this name and tag the latest commit with it.</span>
<span class="org-variable-name">retag</span> = <span class="org-string">"!r() { git tag -d $1 &amp;&amp; git push origin :refs/tags/$1 &amp;&amp; git tag $1; }; r"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Find branches containing commit</span>
<span class="org-variable-name">fb</span> = <span class="org-string">"!f() { git branch -a --contains $1; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Find tags containing commit</span>
<span class="org-variable-name">ft</span> = <span class="org-string">"!f() { git describe --always --contains $1; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Find commits by source code</span>
<span class="org-variable-name">fc</span> = <span class="org-string">"!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Find commits by commit message</span>
<span class="org-variable-name">fm</span> = <span class="org-string">"!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">Remove branches that have already been merged with master</span>
<span class="org-variable-name">dm</span> = <span class="org-string">"!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">List contributors with number of commits</span>
<span class="org-variable-name">contributors</span> = shortlog --summary --numbered
<span class="org-variable-name">ec</span> = config --global -e
<span class="org-comment-delimiter"># </span><span class="org-comment">Pretty log output</span>
<span class="org-variable-name">hist</span> = log --graph --pretty=format:<span class="org-string">'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset'</span> --abbrev-commit --all
<span class="org-variable-name">pp</span> = pull origin $(git_current_branch)
<span class="org-variable-name">gg</span> = push origin $(git_current_branch)
<span class="org-variable-name">rhh</span> = reset HEAD --hard
<span class="org-variable-name">unstage</span> = reset HEAD --
<span class="org-variable-name">last</span> = log -1 HEAD
</pre>
</div>
</div>
</div>
<div id="outline-container-org9891923" class="outline-3">
<h3 id="org9891923">Apply</h3>
<div class="outline-text-3" id="text-org9891923">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">apply</span>]
<span class="org-comment-delimiter"># </span><span class="org-comment">Detect whitespace errors when applying a patch</span>
<span class="org-variable-name">whitespace</span> = fix
</pre>
</div>
</div>
</div>
<div id="outline-container-org3d3c60c" class="outline-3">
<h3 id="org3d3c60c">Colors</h3>
<div class="outline-text-3" id="text-org3d3c60c">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">color</span>]
<span class="org-comment-delimiter"># </span><span class="org-comment">Use colors in Git commands that are capable of colored output when outputting to the terminal</span>
<span class="org-variable-name">ui</span> = true
[color <span class="org-string">"branch"</span>]
<span class="org-variable-name">current</span> = yellow reverse
<span class="org-variable-name">local</span> = yellow
<span class="org-variable-name">remote</span> = green
<span class="org-variable-name">HEAD</span> = red bold
[color <span class="org-string">"diff"</span>]
<span class="org-variable-name">meta</span> = yellow bold
<span class="org-variable-name">frag</span> = magenta bold <span class="org-comment-delimiter"># </span><span class="org-comment">line info</span>
<span class="org-variable-name">old</span> = red <span class="org-comment-delimiter"># </span><span class="org-comment">deletions</span>
<span class="org-variable-name">new</span> = green <span class="org-comment-delimiter"># </span><span class="org-comment">additions</span>
[color <span class="org-string">"status"</span>]
<span class="org-variable-name">added</span> = green
<span class="org-variable-name">changed</span> = yellow
<span class="org-variable-name">untracked</span> = cyan
[color <span class="org-string">"decorate"</span>]
<span class="org-variable-name">HEAD</span> = red bold
<span class="org-variable-name">branch</span> = green
<span class="org-variable-name">remoteBranch</span> = cyan
<span class="org-variable-name">tag</span> = yellow
<span class="org-variable-name">stash</span> = bold yellow
</pre>
</div>
</div>
</div>
<div id="outline-container-org005e9ea" class="outline-3">
<h3 id="org005e9ea">Default Remote</h3>
<div class="outline-text-3" id="text-org005e9ea">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">Use `origin` as the default remote on the `master` branch in all cases</span>
[branch <span class="org-string">"master"</span>]
<span class="org-variable-name">remote</span> = origin
<span class="org-variable-name">merge</span> = refs/heads/master
</pre>
</div>
</div>
</div>
<div id="outline-container-org27b5c46" class="outline-3">
<h3 id="org27b5c46">Push Configuration</h3>
<div class="outline-text-3" id="text-org27b5c46">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">push</span>]
<span class="org-variable-name">default</span> = matching
<span class="org-comment-delimiter"># </span><span class="org-comment">Make `git push` push relevant annotated tags when pushing branches out.</span>
<span class="org-variable-name">followTags</span> = true
</pre>
</div>
</div>
</div>
<div id="outline-container-org8e4fe7a" class="outline-3">
<h3 id="org8e4fe7a">User</h3>
<div class="outline-text-3" id="text-org8e4fe7a">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">user</span>]
<span class="org-variable-name">name</span> = Thomas Dehaeze
<span class="org-variable-name">email</span> = dehaeze.thomas@gmail.com
</pre>
</div>
</div>
</div>
<div id="outline-container-org437daae" class="outline-3">
<h3 id="org437daae">Core configuration</h3>
<div class="outline-text-3" id="text-org437daae">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">core</span>]
<span class="org-comment-delimiter"># </span><span class="org-comment">Use custom `.gitignore` and `.gitattributes`</span>
<span class="org-variable-name">excludesfile</span> = ~/.gitignore_global
<span class="org-comment-delimiter"># </span><span class="org-comment">Treat spaces before tabs and all kinds of trailing whitespace as an error</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">[default] trailing-space: looks for spaces at the end of a line</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">[default] space-before-tab: looks for spaces before tabs at the beginning of a line</span>
<span class="org-variable-name">whitespace</span> = space-before-tab,-indent-with-non-tab,trailing-space
<span class="org-comment-delimiter"># </span><span class="org-comment">Prevent showing files whose names contain non-ASCII symbols as unversioned.</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html</span>
<span class="org-variable-name">precomposeunicode</span> = false
<span class="org-variable-name">pager</span> = diff-so-fancy | less --tabs=<span class="org-highlight-numbers-number">4</span> -RFX
<span class="org-variable-name">autocrlf</span> = input
<span class="org-comment-delimiter"># </span><span class="org-comment">Open vim, start Goyo and enter insert mode on the first line</span>
<span class="org-variable-name">editor</span> = <span class="org-string">"nvim -c ':Goyo' -c 'goto 1' -c 'startinsert'"</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org39b3cb9" class="outline-3">
<h3 id="org39b3cb9">Credentials using pass</h3>
<div class="outline-text-3" id="text-org39b3cb9">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">credential</span>]
<span class="org-variable-name">helper</span> = !pass-git-helper $@
[credential <span class="org-string">"https://github.com"</span>]
<span class="org-variable-name">username</span> = tdehaeze
</pre>
</div>
</div>
</div>
<div id="outline-container-org02367c3" class="outline-3">
<h3 id="org02367c3">Diff-so-fancy</h3>
<div class="outline-text-3" id="text-org02367c3">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">diff-so-fancy</span>]
<span class="org-variable-name">markEmptyLines</span> = false
</pre>
</div>
</div>
</div>
<div id="outline-container-org599c398" class="outline-3">
<h3 id="org599c398">Github</h3>
<div class="outline-text-3" id="text-org599c398">
<div class="org-src-container">
<pre class="src src-conf">[<span class="org-type">github</span>]
<span class="org-variable-name">user</span> = tdehaeze
<span class="org-variable-name">oauth-token</span> = 8cc5b41120f7e9a869c24fa3678667d3d8422e6f
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org3e19276" class="outline-2">
<h2 id="org3e19276">Global Git Ignore</h2>
<div class="outline-text-2" id="text-org3e19276">
<div class="org-src-container">
<pre class="src src-conf">*~
.DS_Store
Session.vim
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-01-11 sam. 22:19</p>
</div>
</body>
</html>