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.

        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 Why Getting Things Done is the Best Productivity System For You How to Beat Procrastination: 29 Ways to Beat It Once and for All To Automate or not to Automate Your Personal Productivity System

        Trending in Technology

        1 7 Tools to Help Keep Track of Goals and Habits Effectively 2 7 Clever Goal Tracker Apps to Make the Most of Your Business in 2019 3 18 Best Time Management Apps and Tools (2019 Updated) 4 16 Less Known Gmail Hacks That Will Super Boost Your Productivity 5 Best 5 Language Learning Apps to Easily Master a New Language

        Read Next

        Advertising
        Advertising
        Advertising

        Last Updated on February 15, 2019

        7 Tools to Help Keep Track of Goals and Habits Effectively

        7 Tools to Help Keep Track of Goals and Habits Effectively

        Now that 2011 is well underway and most people have fallen off the bandwagon when it comes to their New Year’s resolutions (myself included), it’s a good time to step back and take an honest look at our habits and the goals that we want to achieve.

        Something that I have learned over the past few years is that if you track something, be it your eating habits, exercise, writing time, work time, etc. you become aware of the reality of the situation. This is why most diet gurus tell you to track what you eat for a week so you have an awareness of the of how you really eat before you start your diet and exercise regimen.

        Tracking daily habits and progress towards goals is another way to see reality and create a way for you clearly review what you have accomplished over a set period of time. Tracking helps motivate you too; if I can make a change in my life and do it once a day for a period of time it makes me more apt to keep doing it.

        So, if you have some goals and habits in mind that need tracked, all you need is a tracking tool. Today we’ll look at 7 different tools to help you keep track of your habits and goals.

        Joe’s Goals

        Advertising

           

          Joe’s Goals is a web-based tool that allows users to track their habits and goals in an easy to use interface. Users can add as many goals/habits as they want and also check multiple times per day for those “extra productive days”. Something that is unique about Joe’s Goals is the way that you can keep track of negative habits such as eating out, smoking, etc. This can help you visualize the good things that you are doing as well as the negative things that you are doing in your life.

          Joe’s Goals is free with a subscription version giving you no ads and the “latest version” for $12 a year.

          Daytum

            Daytum

            is an in depth way of counting things that you do during the day and then presenting them to you in many different reports and groups. With Daytum you can add several different items to different custom categories such as work, school, home, etc. to keep track of your habits in each focus area of your life.

            Advertising

            Daytum is extremely in depth and there are a ton of settings for users to tweak. There is a free version that is pretty standard, but if you want more features and unlimited items and categories you’ll need Daytum Plus which is $4 a month.

            Excel or Numbers

              If you are the spreadsheet number cruncher type and the thought of using someone else’s idea of how you should track your habits turns you off, then creating your own Excel/Numbers/Google spreadsheet is the way to go. Not only do you have pretty much limitless ways to view, enter, and manipulate your goal and habit data, but you have complete control over your stuff and can make it private.

              What’s nice about spreadsheets is you can create reports and can customize your views in any way you see fit. Also, by using Dropbox, you can keep your tracker sheets anywhere you have a connection.

              Evernote

              Advertising

                I must admit, I am an Evernote junky, mostly because this tool is so ubiquitous. There are several ways you can implement habit/goal tracking with Evernote. You won’t be able to get nifty reports and graphs and such, but you will be able to access your goal tracking anywhere your are, be it iPhone, Android, Mac, PC, or web. With Evernote you pretty much have no excuse for not entering your daily habit and goal information as it is available anywhere.

                Evernote is free with a premium version available.

                Access or Bento

                  If you like the idea of creating your own tracker via Excel or Numbers, you may be compelled to get even more creative with database tools like Access for Windows or Bento for Mac. These tools allow you to set up relational databases and even give you the option of setting up custom interfaces to interact with your data. Access is pretty powerful for personal database applications, and using it with other MS products, you can come up with some pretty awesome, in depth analysis and tracking of your habits and goals.

                  Bento is extremely powerful and user friendly. Also with Bento you can get the iPhone and iPad app to keep your data anywhere you go.

                  Advertising

                  You can check out Access and the Office Suite here and Bento here.

                  Analog Bonus: Pen and Paper

                  All these digital tools are pretty nifty and have all sorts of bells and whistles, but there are some people out there that still swear by a notebook and pen. Just like using spreadsheets or personal databases, pen and paper gives you ultimate freedom and control when it comes to your set up. It also doesn’t lock you into anyone else’s idea of just how you should track your habits.

                  Conclusion

                  I can’t necessarily recommend which tool is the best for tracking your personal habits and goals, as all of them have their quirks. What I can do however (yes, it’s a bit of a cop-out) is tell you that the tool to use is whatever works best for you. I personally keep track of my daily habits and personal goals with a combo Evernote for input and then a Google spreadsheet for long-term tracking.

                  What this all comes down to is not how or what tool you use, but finding what you are comfortable with and then getting busy with creating lasting habits and accomplishing short- and long-term goals.

                  Read Next