dotbare
Manage dotfiles using Git
SYNOPSIS
dotbare command [args...]
dotbare [--version | --help]
PARAMETERS
init
Initializes a new bare Git repository for dotfiles in the default or specified path.
add
Adds a file or directory to be tracked by the dotbare repository, making it eligible for version control.
link
Creates symbolic links for all tracked dotfiles from the repository to their expected locations in the home directory.
unlink
Removes symbolic links created by dotbare link from the home directory.
status
Shows the status of dotfiles, similar to git status, indicating changes, untracked files, etc.
clean
Removes untracked files or directories from the dotbare worktree, based on Git's rules.
update
Fetches and merges changes from a remote repository, updating your local dotfiles.
ignore
Adds a pattern to the .git/info/exclude file to prevent specific files or paths from being tracked.
unignore
Removes a pattern from the ignore list, allowing previously ignored files to be tracked.
push
Pushes committed changes in your local dotbare repository to a remote repository.
pull
Fetches and integrates changes from a remote repository into your local dotbare repository.
--help
Displays help information for dotbare or a specific subcommand, detailing its usage and options.
--version
Displays the current version of the dotbare utility.
-f, --force
Forces an operation to proceed, potentially overwriting existing files (e.g., when linking dotfiles).
-v, --verbose
Enables verbose output, providing more detailed information about the operations being performed.
-q, --quiet
Suppresses output messages, useful for scripting or when minimal interaction is desired.
-p
Specifies the alternative path to the bare Git repository (default: ~/.dotfiles).
DESCRIPTION
dotbare is a command-line utility designed to simplify the management and synchronization of dotfiles (configuration files) across multiple Linux systems. It leverages a bare Git repository to track and manage these files directly from your home directory, avoiding the need for traditional cloning that can clutter your file system.
By treating dotfiles as a Git repository without a working tree, dotbare allows users to easily add, update, and link their configuration files, such as .bashrc, .zshrc, .gitconfig, and .vimrc. It provides a streamlined workflow for maintaining consistent environments, enabling effortless backups and restoration of personalized settings. Users can version control their entire configuration setup, push changes to a remote repository, and pull updates on new or different machines, ensuring their preferred settings are always available and up-to-date. This approach minimizes symlink issues and provides robust version control capabilities inherent to Git.
CAVEATS
Requires a basic understanding of Git concepts for effective usage. Care must be taken with the link and --force flags to prevent accidental overwrites of existing files in the home directory. It's crucial to use dotbare add for new files to ensure they are tracked correctly. The command relies on Git being installed and properly configured on the system.
BARE REPOSITORY CONCEPT
A bare Git repository, as used by dotbare, is a special type of repository that does not contain a working directory. Instead of checking out files into a local directory, it directly manages the repository's contents. In the context of dotbare, this allows Git to track files directly from your home directory, treating them as if they are part of the repository without a separate, visible .git folder in your home directory.
SYMLINKING FOR INTEGRATION
dotbare primarily uses symbolic links (symlinks) to integrate tracked dotfiles from the bare repository into their expected locations within your home directory. This means the actual file content resides in the .dotfiles bare repository, and a 'pointer' or symlink is created in your home directory (e.g., ~/.bashrc pointing to ~/.dotfiles/.bashrc). This method ensures that all modifications are made to the version-controlled file in the bare repository, maintaining consistency and simplifying updates.
HISTORY
dotbare emerged as a modern solution for dotfile management, addressing the growing need for a simple yet powerful way to synchronize configuration files using Git. Its development focuses on streamlining the bare Git repository approach, which gained popularity among power users for managing dotfiles without cluttering the home directory with a working tree. While not a legacy command, it represents an evolution in personal configuration management tools, providing a user-friendly interface over raw Git commands for this specific use case.


