<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom">
<title>Tyler Cipriani: Git-Config Colors and Include</title>
<link href="https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/"/>
<link href="https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/comments.atom" rel="self" type="application/atom+xml"/>
<author>

<name>Tyler Cipriani</name>

</author>

<rights type="html" xml:lang="en">

	Creative Commons Attribution-ShareAlike License
	Copyright © 2017 Tyler Cipriani

</rights>


<id>https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/</id>

<subtitle type="html">Tyler Cipriani</subtitle>
<generator uri="http://ikiwiki.info/">ikiwiki</generator>
<updated>2017-12-31T07:34:57Z</updated>
<entry>
	<title>include gitconfig</title>

	<id>https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/comment_1_4f78f114faf5bd39de5d91653f0b5510/</id>

	<link href="https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/#comment-98f8178f60e2f6f4b0f1a989c624bc1b"/>

	<author><name>mmodell</name></author>





	<updated>2017-01-25T16:32:59Z</updated>
	<published>2017-01-25T10:57:07Z</published>


	<content type="html" xml:lang="en">
	That feature comes so close to being really useful but misses the mark without any variable expansion. &lt;img src=&quot;https://tylercipriani.com/smileys/sad.png&quot; alt=&quot;:-(&quot; /&gt;

	</content>



</entry>
<entry>
	<title>Alternative way for Git to support color schemes</title>

	<id>https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/comment_2_4663c84c26ba88bd564299c22a447a0b/</id>

	<link href="https://tylercipriani.com/blog/2016/09/21/git-config-include-and-colors/#comment-7c77c95a01c2cee9ef33ae740c6e8974"/>

	<author><name>Emily</name></author>





	<updated>2017-12-31T07:34:57Z</updated>
	<published>2017-12-31T07:34:55Z</published>


	<content type="html" xml:lang="en">
	&lt;p&gt;You can simply pass ANSI color code indices as the color arguments. These indices are to a color palette which is very easily changed from within the settings of your terminal or terminal emulator (effectively giving all color-aware console applications support for psuedocolors). &lt;a href=&quot;https://stackoverflow.com/questions/21539607/git-color-ui-support-for-256-colors&quot;&gt;Here&lt;/a&gt; is a post with more information on Git 256 color support. For examples of how to do this on various Windows terminals see &lt;a href=&quot;https://superuser.com/questions/1114549/how-do-you-change-the-color-scheme-in-bash-on-ubuntu-for-windows&quot;&gt;this stackoverflow post&lt;/a&gt;, though it is also possible on Linux and Mac OSX or really any platform with an even remotely modern terminal. This method is superior in ease-of-use as well as portability. View &lt;a href=&quot;https://imgur.com/a/gqIq5&quot;&gt;this Imgur gallery&lt;/a&gt; for several pictures of various color schemes being dynamically changed within my terminal.&lt;/p&gt;
&lt;p&gt;It is important to point out that ANSI color code indices are laid out in a specific way such that certain indices usually correspond to certain usages or hues. This means that, for example, using the color index of 0 is usually the “default background color” of any given theme. &lt;a href=&quot;http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#256-colors&quot;&gt;Here&lt;/a&gt; is a resource which explains the ANSI 256 colors mode escape sequences (note that we are only providing the palette index to Git and don’t need to worry about directly writing an ANSI escape sequence!)&lt;/p&gt;
&lt;p&gt;Here is the Git configuration I am using to generate these indexed color codes within diffs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[color]
branch = auto
decorate = auto
diff = auto
grep = auto
interactive = auto
pager = true
showbranch = auto
status = auto
ui = auto

#color slot= [attributes] foreground [background]
#color = 0 - 256 (ANSI); #000000 (24bit Hex); black, red, green, yellow, blue, magenta, cyan, white (ANSI color words); normal (custom Git Color?)
#attributes: bold dim italic ul blink reverse strike

[color &amp;quot;status&amp;quot;]
header = 8
added = 10
changed = 12
untracked = 14
branch = 0 9
nobranch = bold ul blink 12

[color &amp;quot;diff&amp;quot;]
meta = 3
func = 13
frag = 11
context = 8
old = 12 1
new = 10 3&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note: I “translated” the posted Tomorrow Night Eighties color theme file from the original post into this format as closely as possible without making changes to my terminals built-in color themes. As a result several of the hex code colors have been modified to a closely matching color code index for my terminal’s version of the 16 colors for the Tomorrow Night Eighties theme.&lt;/p&gt;


	</content>



</entry>

</feed>
