STUPID GIT techniques

My apologies if you speak the Queen’s English since that title most likely has a whole different meaning to you than I intended. In fact, I’m speaking about Git, the version manage system. Last time I talked about exactly how the program came to be as well as offered you a few tutorials. If you are a dyed-in-the-wool software application developer, you most likely don’t requirement to be persuaded to utilize Git. however even if you aren’t, there are a great deal of things you can do with Git that don’t in shape the usual mold.

 

Tracking Documents

Git is truly great at tracking modifications in documents. If you compose ordinary text files, Markdown, or TeX files, you are in business. However, there is a technique you can utilize if you utilize Word, OpenOffice, or many other word processing programs. As a benefit, you’ll even be able to work together with others utilizing different programs.

The trick, explained in this publish as well as this one, is to configure Git to utilize a program called Pandoc to convert your input data into Markdown. The Git program can store both, as well as you can explain to it that differences in the Markdown data correspond to the differences in the document file.

Pandoc is a tool worth understanding about anyway. It converts to as well as from a dizzying number of formats. If you want to provide yourself a headache, you can broaden the graphic from their site as well as try to trace all the lines.

We’ve seen this kind of thing work for collaborative textbooks as well as even utilized to track often altering documents like French legal codes going back to the time of Napoleon.

Working on a web Site

You can quickly prolong the concept of tracking documents to tracking HTML pages for your website. You might just utilize it as you produce as well as then upload your data like normal. You can likewise utilize specialized workflows. even if you are the sole creator of the site, being able to rewind to what the site appeared like last week or last month is frequently suddenly useful.

Managing your Bash profile or /etc

If you utilize Linux, you have a great deal of data that configure your environment. things like your .bashrc, .emacs, as well as so on are difficult to keep the exact same if you utilize several machines. Sure, you can rsync them, however if they ever get messed up, it can be difficult to go back as well as figure out what happened. That’s why I composed a system for managing this issue utilizing Git. when it is configured, your machines will immediately pick up any type of modifications you push to the remote hold (I keep mine on GitLab). The system is versatile sufficient to enable for custom configuration per machine as well as even keep random data in sync for you with just a bit setup.

There’s a similar bundle called etckeeper for keeping track of your system-wide configuration in the /etc directory. You might suggest that configuration data are essentially just code, however the intent isn’t coding however keeping version manage as well as synchronization between machines. Also, in the situation of etckeeper, there are adjustments so Git will store some metadata that is important for that application.

Git as a database or Bug Tracker

If you are utilizing Git for development, it only makes sense you might utilize it for tracking bugs, too. In fact, you can utilize Git as a simple database. Don’t expect to run SQL queries — this just shows a name-value pair system (the proverbial NoSQL database).

Of course, you can store SQLite database (or anything else) in Git. If you do, you can play some techniques like the Pandoc technique for documents to assist Git comprehend your databases better.

Twitter (Yes, Twitter)

Ever desired a distributed Twitter implementation? inspect out Madrox. We aren’t truly sure why we want this, however we do.

Text-based Slideshows

Have you ever wished to show a progression of text screens like a slideshow? perhaps not, however if you did, Git can do that, too. It needs a bit assist from vim, though.

So…

Even if you never requirement any type of of these tricks, a few of the techniques utilized to coax Git into doing something unusual may spur you to believe of something else. An obvious concept would be a difference program for Gerbers or some other printed circuit card data format. being able to see what altered between a few revisions of a PC board would be truly useful. Obviously, being able to track schematics would be useful, too. flavor designs should be no issue at all.

Have any type of useful Git hacks? Leave a link in the comments.