In today’s article, we will be talking about backing up your lovely dotfiles. These include files like .vimrc.bashrc, and .gitconfig. Keep in mind, this is simply how I back them up. Feel free to back them up however you want. After all, I am just some random stranger on the internet.

This will allow you to easily pull your dotfiles onto any machine, as long it’s a UNIX-based system, as well as keeping your dotfiles always backed up.

For reference, I used this blog post from Michael Smalley’s blog and made a few adjustments for my misc files I want to backup.
I highly recommend you check it out, as I have been using this way of backing up my dotfiles for quite some time now and use this almost daily. It also saves me a ton of time when I get a new computer.

Step 1. Create a Repository

I like to make a lot of assumptions, which is bad, but this case is no different. I’m going to assume you know what Git is. If you don’t know what Git is, I’d suggest you look into it as it’s a very important tool for programmers.

To begin, I’m going to create a new repository called sample-dotfiles. Keep in mind, you can name this repo whatever you like.

I will be using GitHub in this article, but feel free to use whatever service you like for managing repositories. Keep in mind that if you have sensitive information in your dotfiles, then I would suggest making this repo private. Or if you just don’t want anyone else to see it, I would suggest making the repo private.

Image for post

Creating a new repo in GitHub

Alright, once we have created our new repo for our dotfiles, let’s go ahead and clone it onto our machine by copying the clone button on GitHub.

#tutorial #github #software-development #git #programming

Managing Your Dotfiles With Git
1.40 GEEK