The Smart Way to Maintain your Backup External Hard-Drive

Paul Lee
4 min readSep 13, 2020
image credit: Outright Development

The problem with having your files backed up on an external hard-drive is the maintenance part. I will be suggesting one of the ways you can update your back-up files with much more ease… using Git.

What is Git?

Git is a version control system (VCS) for tracking changes in computer files.

How does this help?

The pain of having backing your files manually on an external hard drive is updating it. There’s so many scenarios:

  • It’s been a hot minute since you’ve backed up your files. You don’t remember which files need to be updated in the external.
  • You reorganized your files. It’d be a pain to reorganize the files in the external too.
  • Dragging and dropping in the right place is too much work.

So how does git help?

Git keeps track of changes in your computer as versions. Git will note what version your external hard drive left off at. When it’s time to update your external, git knows exactly what files have changed.

Let’s Get Started

For the purpose of this demonstration, I will be backing up all my media files from the sd card to an external hard drive.

No internet connection will be required here.

Table of Contents:

  1. Install Git
  2. Initialize Git
  3. Commit your changes (Repeating Step)
  4. Clone to your external (One-time)
  5. Update your external

Step 1: Install Git

If you don’t have git already installed, go ahead and download it from their website. The installation should be pretty straightforward.

If git is successfully installed, you should be able to open Terminal or Command Prompt and execute git --version

Step 2: Initialize Git

The next step is to initialize git in the folder you want to back up.

  1. cd or ‘change directory’ to your folder of interest
  2. initialize git by typing git init
initializing git in powershell

A new folder called .git should appear in that folder now. This is where git will keep track of all the changes.

.git folder appeared

Step 3: Commit your changes (Repeating Step)

The next step is to “commit” your changes. This will be a reoccurring step whenever you want to essentially “save.”

  1. git add . → This will add every file that’s been changed to the staging process
  2. git commit -m "note_what_changed" → This commits all the files in the staging process. Write what’s new in the quotation marks
git commit

That’s it! You’ve saved all your changes. Now it’s time to reflect those changes to the external.

Additional Notes:

  • You can use git status to check what files need to be staged and which files need to be committed
git status

Step 4: Clone to your external (One time)

The first step to back up your folder in your external hard drive is to clone the repository we initialized in the sd card.

  1. cd or change directory to the external hard drive
  2. git clone 'filepath/sd_card/.git' clone the repository from the filepath
  3. make sure you cd into the folder that was copied
git clone

Step 5: Update your external

The last step is what you all came here for, update your external hard drive.

Let’s say you just added a NEW PICTURE.jpg into the sd card. Go ahead and repeat Step 3: Commit your changes

committing new changes

Now you can reflect those changes to your external by simply typing git pull

git pull

You’re done! It’s that simple! This is extremely powerful when you have tons of files and can’t keep track of every minor change.

Please please let me know if you’re having trouble or have better suggestions. Let’s have a discussion :)

Ending Notes

Thank you so much for taking the time to read this! Please feel free to comment and let me know if you want a YouTube tutorial on this 👀.

Also checkout my website (eellaup.com)! I made it with ReactJS and deployed it on Github. P.S. I have no background in this stuff so it’s still a work in progress :)

--

--

Paul Lee

M.S. in CS — GaTech | B.S. in ME — UT Austin