Advertising
Advertising

How To: Use Git to Version Your Writing

How To: Use Git to Version Your Writing

If you are a writer you may have ran into this problem. You are writing like mad, moving things, changing the way something flows. As you are getting into it, you realize.

Hey! This isn’t what I want to say at all! I need to go back.

You feverishly tap CTRL + z (or Command + z for you Mac aficionados) and come to find that your favorite “no frills” text editor has lost your undo history or you aren’t quite sure where you want to go back to.

Good for more than just development

Git is a piece of software that allows the user to control the versions of files in a directory. It allows the user to ‘commit’ a snapshot of any directory to a ‘repository’ that tracks all of the changes between versions of the files.

Git is awesome for development. But, what I have found is that it is awesome for writing as well.

Git allows me to commit my writing every so often so I can get back to where I want to be. It also allows me to ‘branch’ my writing so I can separate it from everything else.

Let’s take a look at how you can use git to control your writing versions.

Installation, Initialization, and committing

I will be covering Windows and Mac here. For you Linux geeks; you should already know how to use git!

Advertising

To install git do the following:

    For Windows:

    Go to git-scm.com, click on the Windows link to the right and download the latest version. Install via the executable and choose the most standard settings. When you get to the Adjusting your PATH environment screen, select the first option, Use Git Bash only and hit next. When at the Configuring the line ending conversions, select the third option, Checkout as-is, commit as-is and hit next. After the install completes click “Finish”.

    For Mac:

    Go to git-scm.com, click on the Mac OS X link to the right and then click the latest .DMG file in the list to download. Launch the DMG from your Downloads directory and double-click the git PKG. Follow the on-screen instructions and enter your user credentials. Close the installer when it is complete.

    OK, now that you have git installed we are going to get geeky and use a terminal in both Windows and Mac.

    To get to the git terminal in Windows go to the Start button and search for ‘git’. Click on ‘Git Bash’ to get to your git command line interface.

    For Mac just open a terminal by going to Applications > Utilities > Terminal.

    Advertising

    Here is where the fun begins. Let’s say you have a folder where you store a bunch of writing. For me that is in my Dropbox/writing folder. If I want to start tracking that directory I can change to that directory via command line then initialize a git repository.

    This will be close to the same on both platforms. To change to a certain directory use the command:

    cd [path-to-your-writing-directory]

    Of course fill in your own directory. My command looks like this in Windows:

      The backslash after ‘My’ is used to tell the terminal that the space after the word ‘My’ is there. You can autocomplete your paths by starting to type a directory and then hitting the ‘Tab’ key.

      And this on my Mac:

        Once you are at the directory you have all of your writing in you can issue the command git init which initializes a blank “repository” for your directory. This puts a .git directory that is initialized. Once your repository is initialized you can add the files to the repository by typing

        Advertising

        git add .

        or

        git add [some-name-of-a-file]

        to add only one file.

        After that you can commit your files to the repository by typing

        git commit -m “This is my first commit (or some other message)”

        ‘-m’ is used to tell git that you want to put a message with your commit. Now you have made your first commit to your new git repository! Congrats, you geek.

        More on committing and branching

        OK, I know that was a little technical, but you are over the hump now. If you want to learn more about git though in your free time, check out Pro Git. It’s free and it is the best tutorial on the inner workings of git.

        Advertising

        So, what committing does is take a “snapshot” of the directory structure or whatever files you told your git repository to watch. If you make a change to a sentence in one of the files that your repository is watching after you just committed and type ‘git status’ you will be presented with the changes that have been made to the watched files. This lets you know that you have “uncommitted” changes to your watched files. You can then easily commit them by issuing the git commit command.

        Another neat feature of git is branching. Branching is the idea of making a totally separate branch of your repository. You can create a new branch by typing:

        git checkout -b this-is-a-new-branch

        You can then make changes to your tracked files totally separate from your “master” branch. This allows you to take different paths with your writing without screwing up something else that was committed.

        To switch back to your “master” branch, type:

        git checkout master

        Also, remember to commit any changes before creating and changing to new branches. If you don’t you may run into issues down the line where some changes get dropped.

        More to come

        Let us know if you think that this is helpful or want to learn more about using git to track files leave some messages in the comments.

        Git is a super application; one that I use everyday. I can’t praise it enough. But, remember, it doesn’t have to be just used by geeks and hackers, writers can use it to keep track of their work and to feel free to explore other writing avenues without losing valuable work they have already created.

        More by this author

        CM Smith

        A technologist and writer who shares advice on personal productivity, creativity and how to use technology to get things done.

        5 Project Management Tools to Get Your Team on Track To Automate or not to Automate Your Personal Productivity System How to Beat Procrastination: 29 Simple Tweaks to Make Design Is Important: How To Fail At Blogging 7 Tools to Help Keep Track of Goals and Habits Effectively 6 Unexpected Ways Journaling Every Day Will Make Your Life Better

        Trending in Technology

        1 11 Brain Training Apps to Train Your Mind and Improve Memory 2 15 Productivity Chrome Extensions To Boost Productivity in 2020 3 20 Best Mac Apps for Productivity You Need in 2020 4 18 Best Time Management Apps and Tools (2020 Updated) 5 40 Top Productivity Apps for iPhone (2020 Updated)

        Read Next

        Advertising
        Advertising
        Advertising

        Last Updated on January 13, 2020

        11 Brain Training Apps to Train Your Mind and Improve Memory

        11 Brain Training Apps to Train Your Mind and Improve Memory

        Whether at work or at school, people these days are under tremendous pressure to perform, perform and perform! Stress and pressure can have adverse affects on the well-being of a person, and need to be controlled.

        Now, this doesn’t mean you make a dash to your nearest therapist. There are a number of wonderful and smart apps that you can use on your phone. These brain training apps have been scientifically designed to target specific areas of the human mind and control harmful emotions such as anxiety, as well as to improve memory and sharpness of the brain.

        Here are 11 iPhone apps that you will not only enjoy but also find useful in keeping your mental health balanced at all times.

        1. Lumosity

        This app consists of games that focus on improving the user’s memory, problem-solving capability, attention span, and thinking. There are three games in each session, and they challenge the brain by changing every time. The user has to complete the games while playing against a clock.

        Free of trial. $15 per month for the full version.

        Advertising

        Luminosity Mind training apps-Lifehack

          2. Fit Brains Trainer

          This brain training app has 10 sets of games that work on different areas of the brain and improve memory as well as concentration. A user is required to finish a particular task from each category on a daily basis and the app tracks the progress by a color coded graph.

          Free.

          Fit Brains Trainer Mind training apps-Lifehack

            3. CogniFit Brain Fitness

            Developed with the help of neuroscientists, this fun app improves a person’s cognitive abilities, which includes memory and concentration. The progress made by the user over a period of time can be tracked. Users can also play challenge rounds with their friends. The app also modifies the difficulty level to suit the profile of the user and provide recommendations based on the results. Spending 20–30 minutes a few times every week can give measurable improvement in the performance of a user.

            First four games free, then $13 a month.

            cognifit-Mind Training Apps-Lifehack

              4. Brain Fitness Pro

              The makers of this app claim that it can improve the IQ of a user, and improve intelligence and memory. The app is fun and is user friendly, and 30 minutes a day can fetch you results in less than three weeks.

              Advertising

              Buy for $3.99.

              5. Happify

              If nothing else makes you happy in life, this app will. Well, this is what the developers claim at least. This app comes loaded with lots of quizzes, polls and gratitude journals, which work on the fundamentals of positive psychology. The app also helps to control stress and emotions to make you feel better.

              Free to use.

              Happify-Mind Training Apps-Lifehack

                6. Clockwork Brain

                You will like the little gold robot that comes in every time to explain the next game you are going to play. While the games are not much different to those offered in apps such as Luminosity, the look and feel reminds me of a workshop from old times.

                Free.

                Advertising

                Clockwork Trsin-Mind Training Apps-Lifehack

                  7. ReliefLink

                  Initially created as an app for suicide prevention, it has found its use as a great app for tracking the mood of the user by taking measure of all things relevant to the user’s mental health. In case the user experiences high emotional stress, the app has a coping mechanism that includes voice-recorded mindfulness, exercises and music for relaxation. There is also a map that informs the user of the nearest therapist and medical facilities for mental health treatment.

                  Relief Link - Mind Training Apps - Lifehack

                    8. Eidetic

                    Eidetic is a memory enhancement app and uses a ‘spaced repetition’ technique to help users memorize information such as important phone numbers, words, credit card details or passwords. It also notifies you when it’s time to take a test to see what you remember, so that you retain information in your long-term memory.

                    Eidetic - Mind Training Apps - Lifehack

                      9. Braingle

                      Braingle helps to maintain the sharpness of the brain and improve the reasoning ability of a person through riddles and optical illusions. It is different from other brain training apps that employ memory and reaction based tests. You can also compete with your friends and family members in figuring out the fun riddles.

                      Free.

                      Briangle- Mind Training Apps-LIfehack

                        10. Not The Hole Story

                        If you have a penchant for solving hard riddles, then this app is a must-have for you. Filled with exclusive riddles along with a simple-to-use interface, the app gives you riddles that you have to solve through a book. You will be given hints along the way, and when you give up, the answers will be revealed. This app will encourage you to broaden your thinking and put your mind to a challenging test.

                        Advertising

                        Free.

                        Not the hole story - Mind Training Apps - Lifehack

                          11. Personal Zen

                          This fun brain training app follows the journey of two animated characters who travel through a field of grass. Personal Zen is a nice app meant for reducing anxiety and trains the brain to focus on the positive aspects. The developer’s advice is to use the app for 10 minutes a day to see the best results.

                          Free.

                          personal zen- mind training apps - lifehack

                            More to Boost Your Brain Power

                            Featured photo credit: NeONBRAND via unsplash.com

                            Read Next