{"id":49377,"date":"2018-06-06T14:40:38","date_gmt":"2018-06-06T19:40:38","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=49377"},"modified":"2018-06-06T14:40:38","modified_gmt":"2018-06-06T19:40:38","slug":"git-version-control-series-introducing-gitweb","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/git-version-control-series-introducing-gitweb\/","title":{"rendered":"Git Version Control series: Introducing Gitweb"},"content":{"rendered":"

This is the third in a series of blog posts around Git and a new feature in version 72,\u00a0Git Version Control<\/a>.\u00a0 See the full list of entries in this series at the end of this post!\u00a0 <\/em><\/p>\n


\n

If you follow our\u00a0feature request site<\/a>, you already know about our upcoming feature, Git Version Control. We’re designing it to make hosting repositories as easy for developers as a “Hello World!” script.<\/p>\n

Alongside our feature, we’re also shipping a great application that’s developed by Git:\u00a0Gitweb.\u00a0It’s a fantastic tool for exploring your repositories from within a simple interface. (Remember, if you need help with some of the Git-specific terms in this post, check out Git’s\u00a0gitglossary<\/a>.)<\/p>\n

What is Gitweb?<\/h3>\n

Gitweb makes finding information a whole lot easier than doing it on the command line. It’s comparable to some of the features included with paid Git hosting, without that pesky “paying for it” part.<\/p>\n

<\/a><\/span><\/p>\n

Gitweb organizes your repository’s information into reports. Summary reports give you the high-level data. Detailed reports let you “drill down” into the specifics. When you navigate between commit-specific reports, Gitweb keeps everything within that context. You can also search within repository information\u00a0and<\/strong>\u00a0within the files themselves.<\/p>\n

Gitweb may be especially helpful if you’re using our new feature to manage deliverable code. You could show changes, like website designs, to your clients without worrying about unwanted edits. All they’d need is access to a cPanel account.<\/p>\n

Explore your repository<\/h3>\n

Gitweb’s simplest functionality allows you to browse your working tree. In oversimplified terms, the “working tree<\/a>” is Git’s name for the file structure for a commit. The default shows you information from the HEAD commit, but you can also view previous versions. You can view this without Gitweb, but sometimes it’s more convenient to have it all at your fingertips.<\/p>\n

<\/a><\/span><\/p>\n

Let’s say you want to check the contents of a file several commits ago. Without Gitweb, you’d check out that commit and then use a command-line text editor (or other tool).\u00a0With Gitweb, you just locate the commit, view the working tree, and click on the file you want. Git and Gitweb call this a “blob<\/a>,” but all you really need to know is that it’s the file contents.<\/p>\n

Compare versions<\/h3>\n

Maybe just viewing a file as it was in a specific commit isn’t telling you everything you need to know. Maybe you need to evaluate line-by-line changes that came into the project recently. Maybe you need to figure out when something was added or deleted. You can view this from the command line, but it can be hard to work with. You’ll have to find what you need in a wall of not-so-pretty text, and digging deeper means running more commands.<\/p>\n

<\/a><\/span><\/p>\n

Gitweb lets you view a comparison of two commits (a “diff<\/a>“) from a couple of different reports. When you’re tracking down changes, diffs are your best bet. You can view the diff for the entire working tree or just one file, and you can compare each commit against the HEAD commit or any other commit in the project.<\/p>\n

<\/a><\/span><\/p>\n

You can even switch between report formats. View changes side-by-side or inline, whichever suits your mood.<\/p>\n

Investigate your project’s history<\/h3>\n

Sometimes, a diff only leads to more questions. Gitweb gives you access to some of Git’s most powerful historical tools to help you answer those questions.<\/p>\n

<\/a><\/span><\/p>\n

You can find reports for:<\/p>\n