{"id":1352,"date":"2015-01-26T11:58:47","date_gmt":"2015-01-26T16:58:47","guid":{"rendered":"http:\/\/jungwon.kim\/?p=1352"},"modified":"2015-01-26T11:58:47","modified_gmt":"2015-01-26T16:58:47","slug":"avoid-escape-characters-in-git","status":"publish","type":"post","link":"https:\/\/blog.jungwon.kim\/?p=1352","title":{"rendered":"Avoid escape characters in GIT"},"content":{"rendered":"<p><a href=\"http:\/\/michael.otacoo.com\/linux-2\/avoid-escape-characters-in-git\/\">http:\/\/michael.otacoo.com\/linux-2\/avoid-escape-characters-in-git\/<\/a><\/p>\n<p>The first one is to change the pager to &#8220;more&#8221;.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\" data-lang=\"text\">git config --global core.pager more\n<\/code><\/pre>\n<\/div>\n<p>The second one is to append an additional command with &#8220;less -r&#8221;.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\" data-lang=\"text\">git diff --color | less -r\ngit log -p --color | less -r\n<\/code><\/pre>\n<\/div>\n<p>And you get a nice colored output.<\/p>\n<p>Here is another solution which is more portable to my mind, and it is the one I use.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\" data-lang=\"text\">git config --global core.pager \"less -r\"\n<\/code><\/pre>\n<\/div>\n<p>This directly appends the modified less command when git pager is invocated to print correctly escape characters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/michael.otacoo.com\/linux-2\/avoid-escape-characters-in-git\/ The first one is to change the pager to &#8220;more&#8221;. git config &#8211;global core.pager more The second one is to append an additional command with &#8220;less -r&#8221;. git diff &#8211;color | less -r git log -p &#8211;color | less<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1352","post","type-post","status-publish","format-standard","hentry","category-cs"],"_links":{"self":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts\/1352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1352"}],"version-history":[{"count":0,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts\/1352\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}