Skip to content
onepub-devPublic

About

Provides a simple mechanism for tracking all of your linux configuration files like ~/.bashrc with git.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

dotfiles

inspired by the article by mitxela

https://mitxela.com/projects/dotfiles_management

Provides a simple mechanism for tracking all of your linux configuration files like ~/.bashrc with git.

dotfiles creates a git repo and allows you to add in files from anywhere in your directory tree.

install dotfiles

Version 2.x requires Dart 3.13 or later. The command below installs the public pub.dev release. If you use the OnePub-hosted package, configure your OnePub registry credentials and package source before activating it.

dart pub global activate dotfiles

dotfiles init

add files to your dot file repo

dotfiles add ~/.bashrc ~/.profile
dotfiles add ~/.local/*.lbox
dotfiles add '~/.local/*.lbox'
dotfiles add '/path/with spaces/settings.conf'

add accepts one or more paths. Your shell can expand wildcards, or you can quote a glob pattern and let dotfiles expand it (including ~/). Existing literal filenames take priority over wildcard characters in their names. If any path or pattern matches nothing, no files are staged. Use -- before paths beginning with a dash.

On Windows, dotfiles expands patterns itself, including native backslash paths:

dotfiles add "$env:USERPROFILE\.local\*.lbox"

commit files added or changed files

dotfiles commit

list of tracked dotfiles

dotfiles list

run any git command against your dotfile repo

dotfiles <any git command>

For Git commands that share a name with a built-in command (add, commit, init, list, or publish), use dotfiles git <git command>. For example, dotfiles git add --all forwards the arguments to Git exactly as written.

push dotfiles to remote repo

Create an empty private repository on GitHub, then publish your committed dotfiles with one command:

dotfiles publish git@github.com:your-name/your-dotfiles.git

HTTPS URLs such as https://github.com/your-name/your-dotfiles.git also work. Authenticate with your Git host as you would for a normal git push.

publish adds the origin remote, pushes the current branch, and sets its upstream so future backups can use dotfiles push. It publishes existing commits; add and commit changes first. It does not create the GitHub repository. Review the committed files before publishing, especially credentials and other private configuration.

You can repeat the command with the same URL. If origin already points elsewhere, the command stops without replacing it. Inspect the configuration with dotfiles git remote -v. Pushes never force an overwrite: if the remote contains conflicting history, resolve it using the forwarded Git commands before trying again.

About

Provides a simple mechanism for tracking all of your linux configuration files like ~/.bashrc with git.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages