{"id":2870,"date":"2011-02-15T01:44:59","date_gmt":"2011-02-14T20:14:59","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=2870"},"modified":"2016-12-19T15:04:56","modified_gmt":"2016-12-19T09:34:56","slug":"git-lighten-up-a-bit","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/git-lighten-up-a-bit\/","title":{"rendered":"GIT &#8230; Lighten up a Bit"},"content":{"rendered":"<p style=\"text-align: left\">Hello there  ..<\/p>\n<p style=\"text-align: left\">Writing my first blog , I am still amazed by the effectiveness of working with Git . No matter how many times you mess up.. you can \u00a0still end up with a Clean Working directory. (Believe me .. \ud83d\ude09 \u00a0) . \u00a0I have also heard about the frustrating merge situations people have been in .. but I guess it has more to do with working systematically rather than with Git itself .<\/p>\n<p style=\"text-align: left\">The one thing you can do to make life a bit more easy on git is brighten up the environment. A plain white\/black color combo for a terminal can make it difficult to track large number of line additions such as in git diff (even though it is represented by a +\/- sign .. we can still make it look better).<\/p>\n<p style=\"text-align: left\">So the one thing we <strong>can do<\/strong> is play around with it and make it much more lively by adding some color.<\/p>\n<p style=\"text-align: left\">First things first \u00a0&#8230; Adding Some color .Adding color to your command output can be as simple as something like<\/p>\n<p style=\"text-align: left\"><strong>git config &#8211;global color.diff auto<\/strong><\/p>\n<p style=\"text-align: left\">This basically sets up a git config file with a color property in diff set to auto. Thats it .. simply enter git diff and\u00a0viola\u00a0&#8230;<\/p>\n<p><strong>Kodachrome<\/strong> is back \ud83d\ude00<\/p>\n<p style=\"text-align: left\">Anytime you want to remove it simply put in<\/p>\n<p style=\"text-align: left\"><strong>git \u00a0config &#8211;global color.diff false<\/strong> ..<\/p>\n<p style=\"text-align: left\">Similarly one can do the same with status and branch outputs with<\/p>\n<p style=\"text-align: left\"><strong>git config &#8211;global color.status auto<\/strong><\/p>\n<p style=\"text-align: left\"><strong>git config &#8211;global color.branch auto<\/strong><\/p>\n<p style=\"text-align: left\">You can also enter your information with<\/p>\n<p style=\"text-align: left\"><strong>git config &#8211;global user.name \u00a0&#8220;Manoj&#8221;<\/strong><\/p>\n<p style=\"text-align: left\"><strong>git config &#8211;global user.email &#8220;manoj@intelligrape.com &#8220;<\/strong><\/p>\n<p style=\"text-align: left\">Now these files get added to your Git config file instantly but you can also separately go into your Git config file and add these entries .. \u00a0Just type \u00a0<strong> ~\/vim .gitconfig<\/strong><\/p>\n<p style=\"text-align: left\">The file now would look something like this &#8211;<\/p>\n<div style=\"text-align: left\">\n<div><strong>[color]<\/strong><\/div>\n<div><strong>diff = auto<\/strong><\/div>\n<div><strong>status = auto<\/strong><\/div>\n<div><strong>branch = auto<\/strong><\/div>\n<div><strong>log = auto<\/strong><\/div>\n<\/div>\n<div style=\"text-align: left\">You can further modify it to look something like<\/div>\n<div style=\"text-align: left\"><strong>[color &#8220;status&#8221;]<\/strong><\/div>\n<div style=\"text-align: left\"><strong>added = yellow<\/strong><\/div>\n<div style=\"text-align: left\"><strong>changed = green<\/strong><\/div>\n<div style=\"text-align: left\"><strong>untracked = cyan<\/strong><\/div>\n<div style=\"text-align: left\">Now once we have gotten into the Config file .. we might as well use the file to define some <strong>aliases<\/strong> .. Yes the same things that we inserted into our .bashrc files but the only thing is the aliases here would be git commands only. This not only removes the clutter in your .bashrc file but also provides a singular space to store your git aliases.<\/div>\n<div style=\"text-align: left\">An alias in the config file would be something like<\/div>\n<div style=\"text-align: left\"><strong>[alias]<\/strong><\/div>\n<div style=\"text-align: left\"><strong>psh = push origin master<\/strong><\/div>\n<div style=\"text-align: left\"><strong>pu = pull origin master<\/strong><\/div>\n<div style=\"text-align: left\">\n<p>Now if you&#8217;ve had problems with the git merge tool being a tad bit simplistic .. you could go in for something like a <strong>Meld<\/strong> that gives you a efficient and powerful Linux GUI. \u00a0 Just install it and specify something like<\/p>\n<p>git config &#8211;global merge.tool meld<\/p>\n<\/div>\n<div style=\"text-align: left\">Thats all you need to use Meld .<\/div>\n<div style=\"text-align: left\">Cheers<\/div>\n<div style=\"text-align: left\">\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><strong><\/strong><strong>Manoj Mohan<\/strong><\/p>\n<\/div>\n<div style=\"text-align: left\"><a href=\"http:\/\/www.tothenew.com\" target=\"_blank\">Manoj (at) Intelligrape (dot) com<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello there .. Writing my first blog , I am still amazed by the effectiveness of working with Git . No matter how many times you mess up.. you can \u00a0still end up with a Clean Working directory. (Believe me .. \ud83d\ude09 \u00a0) . \u00a0I have also heard about the frustrating merge situations people have [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[1],"tags":[375,461],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2870"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=2870"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2870\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=2870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=2870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=2870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}