How dotfiles can save you a lot of time
Tags: github, automation, dotfiles, bash
Published: 2021-03-01 15:29:13

---
title: How dotfiles can save you a lot of time
published: true
description: As a developer, I try to automate and optimize all of my processes and workflow. Dotfiles can save you a lot of time.
tags: github, automation, dotfiles, bash
cover_image: https://miro.medium.com/max/2000/1*8s6_M-tUuSvB_z45fQgitg.png
canonical_url: https://minompi.medium.com/how-dotfiles-can-save-you-a-lot-of-time-1f34e8293aa2
---

As a developer, I try to automate and optimize all of my processes and workflow.

Sometimes it’s difficult to understand how you can optimize your work daily life, but for me, one of the best things that can help me a lot is sharing and discussing my ideas, my thoughts, my approaches, and my code with other developers.
Sharing and discussing your leaks with other developers can open your mind to new approaches and fixes.

Every time I try to talk to other developers about a problem, or a doubt, usually, in the end, I feel more conscious about the problem with a new idea in mind to develop.
The discussion can be done **asynchronously** or **synchronously**.

![](https://cdn-images-1.medium.com/max/2000/1*0chpI9TjnW2dMPm0FfIXFw.jpeg)

For example, a discussion could be synchronous when you are doing pair programming with someone or when you are in a meeting.
For asynchronous discussion, I mean for example: writing your problem in a chat and waiting for an answer from another developer.

Another discussion method could be using **pull requests** and waiting for other developers that review your code or open a new discussion about it.

All those practices are fine; it depends on the problem and on the team.
But trying to receive feedback about a solution or another point of view about a problem is one of the most important things to do to become better every day.

As a developer usually I work on many projects and sometimes with different machines with different configurations.
I try to understand an efficient way to **optimize** my work using my configurations wherever I want.

A couple of years ago, while discussing with other developers, I found that many people were sharing their configurations on **GitHub**.
Inside those repositories, there were configurations, discussions about optimizations, problems solved with **bash scripts**, and many other useful things.

For this reason, I have created my personal dotfiles repositories, and you can see it here: [https://github.com/AlessandroMinoccheri/dotfiles](https://github.com/AlessandroMinoccheri/dotfiles)

## What is a dotfiles repository?

A dotfiles repository is a set of configurations that can be used, usually, on every Linux or OSX system.
You can change it on your personal computer, or inside a new server and you can always get that repository with your configurations in a few seconds.
My dotfiles repository is evolving day after day because sometimes I fix an issue, I insert a new shortcut, or I install a new useful plugin.
So it’s always in evolution, it depends on what you are using and what is useful for you.

But, pay attention, there are things that you don’t have to commit inside a dotfiles repository like:

* passwords

* API key

* ssh key

* …

So **don’t commit personal information or secret passwords**.
You must commit only things that everyone can see without problems.

## My personal dotfiles repository

In my repository I have created some scripts:

    ./copy_dotfiles.sh

This script is used when you change something inside your shared configuration and you want to commit it into your dotfiles repository.
For example, I copy bash_profile and zsh configurations inside a folder with the same name:

    printf “\nCopying profile configuration”
    cp ~/.bash_profile bash_profile
    printf “\nCopying personal zsh configuration”
    cp -rf ~/.zsh/ zsh

After launching the copy script I make a commit with a significant message about the last changes.
Another essential script is:

    ./install_dotfiles.sh

The script is used when you want to import your configurations inside your actual system.
Example of code inside the script:

    printf “\nInstalling profile configuration”
    cp -f bash_profile ~/.bash_profile
    printf “\nCopying personal zsh configuration”
    cp -rf zsh/ ~/.zsh/

In this case, I take directories from my repository and copy those inside the correct path for my system.

Now you can copy and install your configurations whenever and wherever you want.
In my dotfiles repository I have put configurations for:

* bash_profile

* zsh

* nvim

* git

* oh-my-zsh

As I wrote earlier in this article, **sharing and discussing with other people can open your mind to new solutions**.
In my case, I optimized a lot of my configurations by reading other dotfiles repositories and asking questions about some things that I couldn’t understand.

![](https://cdn-images-1.medium.com/max/2956/1*8s6_M-tUuSvB_z45fQgitg.png)

Also, it’s a good practice to open issues inside other dotfiles repositories for asking questions, fixing a problem, or asking for clarification.
It’s up to you now, you can create your dotfiles repository and try to share and discuss your configurations with other developers

Please write to me if you have any questions and follow me on [Twitter](https://twitter.com/minompi) to stay updated with new articles or tips.