<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jaime Escobar</title>
    <description>The latest articles on DEV Community by Jaime Escobar (@jamescose).</description>
    <link>https://dev.to/jamescose</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1545572%2F8c1a7f1a-7c8a-45cc-a66c-0e113dcb2d6a.jpg</url>
      <title>DEV Community: Jaime Escobar</title>
      <link>https://dev.to/jamescose</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jamescose"/>
    <language>en</language>
    <item>
      <title>From Setup Hell to Dev Heaven: Why You Should Use Dotfiles</title>
      <dc:creator>Jaime Escobar</dc:creator>
      <pubDate>Fri, 09 May 2025 18:23:59 +0000</pubDate>
      <link>https://dev.to/jamescose/from-setup-hell-to-dev-heaven-why-you-should-use-dotfiles-1pje</link>
      <guid>https://dev.to/jamescose/from-setup-hell-to-dev-heaven-why-you-should-use-dotfiles-1pje</guid>
      <description>&lt;p&gt;I’m not the most careful person when it comes to laptops — or any device, really. At one of my former jobs, I ended up replacing my machine &lt;em&gt;three times&lt;/em&gt; (not proud of it 💀). By the third round, I was already sick of going through the whole setup process again. That pain led me to discover something that changed my workflow for good: &lt;strong&gt;dotfiles&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, I’ll walk you through what dotfiles are, why they matter, how to version-control them, and how to back up and restore your full dev setup without the pain.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What Are Dotfiles? Why Version-Control Them?
&lt;/h2&gt;

&lt;p&gt;Dotfiles are hidden configuration files on Unix-based systems (like macOS, Linux, or WSL). They store preferences for tools like your shell, text editor, terminal multiplexer, and more — allowing you to personalize your development environment.&lt;/p&gt;

&lt;p&gt;By version-controlling your dotfiles with Git, you keep your setup consistent across machines, save time when setting up a new environment, and can easily track or roll back changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗂️ Common Dotfiles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bash users:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.bash_profile&lt;/code&gt;: Runs once at login; good for environment variables.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.bashrc&lt;/code&gt;: Runs on new terminal sessions; good for aliases, functions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Zsh users:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.zshrc&lt;/code&gt;: Main Zsh config file.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other useful ones:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.vimrc&lt;/code&gt;: Vim behavior and appearance&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gitconfig&lt;/code&gt;: Global Git settings&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.tmux.conf&lt;/code&gt;: Tmux layout and bindings&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.config/&lt;/code&gt;: App configs (e.g., &lt;code&gt;gh&lt;/code&gt;, &lt;code&gt;gcloud&lt;/code&gt;) — these are usually defaults added during installation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;⚠️ Note: Some dotfiles may contain sensitive info (tokens, credentials). Be careful when committing them or consider using tools like &lt;code&gt;chezmoi&lt;/code&gt; for secret management.&lt;/p&gt;

&lt;h3&gt;
  
  
  🍺 Brewfile: Your Dev Toolkit Snapshot
&lt;/h3&gt;

&lt;p&gt;While not technically a dotfile, &lt;code&gt;Brewfile&lt;/code&gt; is essential if you use &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; — the package manager for macOS (and Linux). And if you're a macOS user, you'll love the &lt;a href="https://formulae.brew.sh/cask/" rel="noopener noreferrer"&gt;Cask project&lt;/a&gt; because it lets you install and manage GUI macOS applications directly from the terminal (no more "To install, drag this icon..."). Here's a searchable list of available Cask apps: &lt;a href="https://formulae.brew.sh/cask/" rel="noopener noreferrer"&gt;https://formulae.brew.sh/cask/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can export all your installed packages with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew bundle dump &lt;span class="nt"&gt;--file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/.dotfiles/Brewfile &lt;span class="nt"&gt;--describe&lt;/span&gt; &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;brew&lt;/code&gt;: CLI tools from Homebrew core&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cask&lt;/code&gt;: GUI apps (via &lt;a href="https://formulae.brew.sh/cask/" rel="noopener noreferrer"&gt;Cask&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mas&lt;/code&gt;: Mac App Store apps (via &lt;a href="https://github.com/mas-cli/mas" rel="noopener noreferrer"&gt;&lt;code&gt;mas&lt;/code&gt; CLI&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tap&lt;/code&gt;: External repos&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;vscode&lt;/code&gt;: VSCode extensions (if installed via Homebrew)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I prefer to exclude VSCode extensions from &lt;code&gt;Brewfile&lt;/code&gt; and sync them via GitHub login.&lt;/p&gt;

&lt;h3&gt;
  
  
  📦 Example: My Public Dotfiles Repo
&lt;/h3&gt;

&lt;p&gt;Want to see a live example? Check out &lt;a href="https://github.com/jaimescose/.dotfiles-blog" rel="noopener noreferrer"&gt;&lt;code&gt;.dotfiles-blog&lt;/code&gt;&lt;/a&gt; — a public version of my personal dotfiles. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.zshrc&lt;/code&gt;, &lt;code&gt;.gitconfig&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A &lt;code&gt;Brewfile&lt;/code&gt; to restore packages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Helpful shell aliases&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ☁️ Backing Up Your Dotfiles (Step-by-Step)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Create a &lt;code&gt;.dotfiles&lt;/code&gt; directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/.dotfiles
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Move your config files into it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.zshrc ~/.dotfiles/.zshrc
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.gitconfig ~/.dotfiles/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Create symlinks back to your home directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.dotfiles/.zshrc ~/.zshrc
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.dotfiles/.gitconfig ~/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lets your shell use the configs while keeping them under version control.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Add custom Zsh aliases (optional but recommended — I use one to back up my Homebrew packages)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; ~/.dotfiles/.zsh_aliases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then edit it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;brew_dump&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"brew bundle dump --describe --file=~/.dotfiles/Brewfile"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;brew_redump&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"brew bundle dump --describe --force --file=~/.dotfiles/Brewfile"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gac&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git commit -am'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;grevert&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git reset --soft HEAD~1'&lt;/span&gt;
&lt;span class="c"&gt;# add others that you find useful&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this line to your &lt;code&gt;.zshrc&lt;/code&gt; to load them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.dotfiles/.zsh_aliases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reload your shell&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Create a &lt;code&gt;.gitignore&lt;/code&gt; file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Brewfile.lock.json"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.dotfiles/.gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Initialize a Git repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.dotfiles
git init
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit of dotfiles"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. Push to GitHub
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# if you have GitHub CLI installed&lt;/span&gt;
gh repo create .dotfiles &lt;span class="nt"&gt;--private&lt;/span&gt; &lt;span class="nt"&gt;--push&lt;/span&gt; &lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin git@github.com:&amp;lt;your-username&amp;gt;/.dotfiles.git
git branch &lt;span class="nt"&gt;-M&lt;/span&gt; main
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Done! Your environment is now portable.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Restoring on a New Machine
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Install Xcode CLI tools (this is required for Git, compilers, and many developer tools — macOS users)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;--install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Install Homebrew
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Install Git (Xcode includes Git, but if you skipped it because you are not a macOS user)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Clone your dotfiles repo
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/your-username/.dotfiles.git ~/.dotfiles
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Create symlinks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.dotfiles/.zshrc ~/.zshrc
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.dotfiles/.gitconfig ~/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Install your tools
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew bundle &lt;span class="nt"&gt;--file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/.dotfiles/Brewfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. Reload your shell
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧰 Alternatives to Manual Dotfiles Management
&lt;/h2&gt;

&lt;p&gt;You could certainly create a Bash script to automate some of the steps above, or leverage existing tools that make dotfile management easier. While I like to keep my setup simple, here are a few tools worth exploring:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.chezmoi.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;Chezmoi&lt;/strong&gt;&lt;/a&gt; – Declarative, encrypted, cross-platform dotfile manager with templating and host-specific configs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/anishathalye/dotbot" rel="noopener noreferrer"&gt;&lt;strong&gt;Dotbot&lt;/strong&gt;&lt;/a&gt; – Git + YAML-based manager that automates symlinks and setup commands.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.gnu.org/software/stow/" rel="noopener noreferrer"&gt;&lt;strong&gt;GNU Stow&lt;/strong&gt;&lt;/a&gt; – Simple, folder-based symlink manager that works like a charm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://yadm.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;YADM&lt;/strong&gt;&lt;/a&gt; – Git-based dotfiles manager with built-in secret management and no symlinks needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/thoughtbot/rcm" rel="noopener noreferrer"&gt;&lt;strong&gt;rcm&lt;/strong&gt;&lt;/a&gt; – A flexible dotfile manager from Thoughtbot for multiple-host environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🎯 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Whether you're setting up a new machine or tired of configuring everything from scratch every time, dotfiles can save your sanity. Start small — back up your &lt;code&gt;.zshrc&lt;/code&gt; and &lt;code&gt;.gitconfig&lt;/code&gt; — and build from there. You'll thank yourself the next time your laptop dies unexpectedly 💀&lt;/p&gt;

&lt;p&gt;Let me know if you use another tool or have a setup you love!&lt;/p&gt;

</description>
      <category>dotfiles</category>
      <category>git</category>
      <category>linux</category>
      <category>zsh</category>
    </item>
  </channel>
</rss>
