{"id":12831,"date":"2019-03-28T23:02:51","date_gmt":"2019-03-28T23:02:51","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12831"},"modified":"2019-03-28T23:02:51","modified_gmt":"2019-03-28T23:02:51","slug":"tig-a-command-line-browser-for-git-repositories","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/tig-a-command-line-browser-for-git-repositories\/","title":{"rendered":"Tig \u2013 A Command Line Browser for Git Repositories"},"content":{"rendered":"<p>In this article, we would like to introduce to you another useful command-line based interface to git called\u00a0<strong>Tig<\/strong>.<\/p>\n<p><strong>Tig<\/strong>\u00a0is a free open source, cross platform\u00a0<strong>ncurses-based<\/strong>\u00a0text-mode interface for git. It is a straight-forward interface to git that can help in staging changes for commit at chunk level and works as a pager for output from different Git commands. It can run on Linux, MacOSX as well as Windows systems.<\/p>\n<h3>How to Install Tig in Linux Systems<\/h3>\n<p>To install\u00a0<strong>Tig<\/strong>\u00a0in Linux, you need to first clone the Tig repository to your system and install it as shown.<\/p>\n<pre>$ git clone git:\/\/github.com\/jonas\/tig.git\r\n$ make\r\n$ make install\r\n<\/pre>\n<p>By default, tig will be installed under\u00a0<code>$HOME\/bin<\/code>\u00a0directory, but ff you wish to install it in another directory under in your PATH, set prefix to the desired path, as shown.<\/p>\n<pre>$ make prefix=\/usr\/local\r\n$ sudo make install prefix=\/usr\/local<\/pre>\n<p>Once you have installed\u00a0<strong>Tig<\/strong>\u00a0on your system, using the\u00a0<a href=\"https:\/\/www.tecmint.com\/cd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">cd command<\/a>\u00a0get into your any of your\u00a0<a href=\"https:\/\/www.tecmint.com\/install-git-centos-fedora-redhat\/\" target=\"_blank\" rel=\"noopener\">local git repositories<\/a>\u00a0and run tig without any arguments, which should show all commits for the repository.<\/p>\n<pre>$ cd ~\/bin\/shellscripts\/\r\n$ tig  \r\n<\/pre>\n<div id=\"attachment_29035\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Commits.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29035\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Commits.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Commits.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Commits-768x476.png 768w\" alt=\"Show Git Repository Commits\" width=\"862\" height=\"534\" aria-describedby=\"caption-attachment-29035\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29035\" class=\"wp-caption-text\">Show Git Repository Commits<\/p>\n<\/div>\n<p>To quit\u00a0<strong>Tig<\/strong>, press\u00a0<code>q<\/code>\u00a0to close it.<\/p>\n<h4>Display Repository Activity Log<\/h4>\n<p>To display a log activities of the above repository, use the\u00a0<strong>log<\/strong>\u00a0sub-command.<\/p>\n<pre>$ tig log\r\n<\/pre>\n<div id=\"attachment_29037\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/View-Git-Repository-Log.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29037\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/View-Git-Repository-Log.png\" alt=\"View Git Repository Log\" width=\"722\" height=\"534\" aria-describedby=\"caption-attachment-29037\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29037\" class=\"wp-caption-text\">View Git Repository Log<\/p>\n<\/div>\n<h4>Show Repository Objects<\/h4>\n<p>The\u00a0<strong>show<\/strong>\u00a0sub-command allows you to display one or more objects such as\u00a0<strong>commits<\/strong>\u00a0and many more, in a more detailed way, as shown.<\/p>\n<pre>$ tig show commits\r\n<\/pre>\n<div id=\"attachment_29038\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Objects-.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29038\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Objects-.png\" alt=\"Show Git Repository Objects\" width=\"722\" height=\"534\" aria-describedby=\"caption-attachment-29038\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29038\" class=\"wp-caption-text\">Show Git Repository Objects<\/p>\n<\/div>\n<h4>Search A Pattern\/Word in Git Files<\/h4>\n<p>You can also search for a particular pattern (for example the word\u00a0<strong>check<\/strong>) in your git files with the\u00a0<strong>grep<\/strong>\u00a0sub-command, as shown.<\/p>\n<pre>$ tig grep check \r\n<\/pre>\n<div id=\"attachment_29039\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Search-in-Git-Repository.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29039\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Search-in-Git-Repository.png\" alt=\"Search a Work in Git Repository\" width=\"722\" height=\"534\" aria-describedby=\"caption-attachment-29039\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29039\" class=\"wp-caption-text\">Search a Work in Git Repository<\/p>\n<\/div>\n<h4>Display Git Repository Status<\/h4>\n<p>To display status of your git repository use\u00a0<strong>status<\/strong>\u00a0sub-command as shown.<\/p>\n<pre>$ tig status\r\n<\/pre>\n<div id=\"attachment_29040\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Status.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29040\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Git-Repository-Status.png\" alt=\"Show Git Repository Status\" width=\"662\" height=\"249\" aria-describedby=\"caption-attachment-29040\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29040\" class=\"wp-caption-text\">Show Git Repository Status<\/p>\n<\/div>\n<p>For more\u00a0<strong>Tig<\/strong>\u00a0usage, please refer to help section or visit the Tig Github repository at\u00a0<a href=\"https:\/\/github.com\/jonas\/tig\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/jonas\/tig<\/a>.<\/p>\n<pre>$ tig -h\r\n<\/pre>\n<p><strong>Tig<\/strong>\u00a0is a simple ncurses-based interface to git repositories and mainly act as a Git repository browser. Give us your feedback or ask any questions via the comment form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/tig-a-commandline-browser-for-git-repositories\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we would like to introduce to you another useful command-line based interface to git called\u00a0Tig. Tig\u00a0is a free open source, cross platform\u00a0ncurses-based\u00a0text-mode interface for git. It is a straight-forward interface to git that can help in staging changes for commit at chunk level and works as a pager for output from different &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/tig-a-command-line-browser-for-git-repositories\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Tig \u2013 A Command Line Browser for Git Repositories&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12831","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12831"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12831\/revisions"}],"predecessor-version":[{"id":12832,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12831\/revisions\/12832"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}