{"word_count": 783, "character_count": 4989}
Git is a version control software, which helps software developers develop more software. Sounds complicated? It is! However, it has two features that you may find useful for writing (provided that happens in plain text files such as .txt, .md, .tex, etc.): commits and branches.[caption id="attachment_282" align="alignright" width="157"] A project folder for a manuscript, written in LaTeX, and upgraded to a Git repo.[/caption]But first, a short introduction into Git's basic concepts and terminology. The simplest way to install it is via the gratis GitHub Desktop apps. When you tell Git to assist you with a project, it settles itself into an invisible sub-folder.git (Surprise!). Thus, your project folder with the files and sub-folders that you see in your file manager is upgraded to a repository. In this repository, Git will now assist you by watching for changes in your files, while you can continue working on them normally. In other words: Git is a watchdog for your files, with your project folder as its range, and the .git sub-folder as its dog shed. Woof! Does it bite, or does it only want to play? We will find out...Upgrading a project folder to a Git repository virtually splits it into two parts: history and staging area. The dog metaphor is breaking down here, but please bear with me. The history is simply the list of changes that were already committed, while the staging area is where Git shows you these changes.Commits can simplify the reviewing processOnce you edited a file and saved the changes, Git visualizes these for you. Now, you can summarize logically connected changes (throughout one file, or many) as a commit and save that to the repository together with a commit message. As a service to your future self, or to whoever will review your work, you should concisely explain what the changes are or why they are relevant. While writing an academic manuscript, a commit could for example include the addition of an image file, plus its caption into the document text, plus changes to the text that refer to the new figure. Or, a simple proof-reading session.[caption id="attachment_289" align="aligncenter" width="808"] History of a Git repository for a research article with several commits (left) and visualized changes within one of those (right).[/caption]This visualization of changes can be helpful for reviewing work. Either by yourself, for example by proof-reading yesterday's changes in the morning, and then committing them. Or by your supervisor, co-author(s), etc. If they are even well versed in using Git themselves, it also becomes possible to author documents in a decentralized, collaborative manner.Branches can help keeping the focusIn many software projects, it is necessary to keep a certain production status of the source code (e.g. that which underlies a publicly released version of that software) separate from the latest developments, experimental side projects, and/or code that fixes bugs. Git branches provide this tool for separating different contexts within a project. When a new branch is... Well, branched off, the same set of files in a project can be developed into a different direction. Like tree branches: having grown from a common root and stem, one branch may go straight up towards the light and produce many leaves, while another branch grows more horizontally and later carries the fruit. However, Git branches can be merged, thus integrating for example the code for a new software feature or a bug-fix into the code that will be released as the next version of the software.In academic writing, this model can be adapted by for example keeping the content and the formatting of a LaTeX document separate from each other. This can help to concentrate on one or the other at the right times, instead of letting our monkey minds switch back and forth.[caption id="attachment_290" align="alignleft" width="300"] Switching branches swaps the respective files on that branch. This can help to focus on...[/caption][caption id="attachment_291" align="alignright" width="300"] ...different contexts, such as writing and formatting. Merging finalises the document.[/caption]Final wordsStarting with Git is hindered by the fact that it's optimized for software development. For text authors, there will be some hoops to jump through. If you are interested to learn more about using Git(Hub) in a scientific context, please see this audio slideshow specifically about lab journalling and this list of suggested reading.What are your thought on Git for writing? Are your Git-ing your thesis? And if so, how are you Git-ing it right? And most importantly: What should we suggest to the developers of Git clients to make their software more useful for academic authors who want to track writing projects?Beitrag von Katrin Leinweber | @kaleimai#Algae #Bacteria biochemistry @unikonstanz. #FLOSS power user &#38; bug-reporter. #R #Python &#38; #Git noob. Hälfte des @KonSciencePodcasts. #OpenScience #TechSupport