{"id":25450818,"url":"https://github.com/opennomad/dotgit","last_synced_at":"2026-04-11T02:03:14.077Z","repository":{"id":277776889,"uuid":"933458455","full_name":"opennomad/dotGit","owner":"opennomad","description":"dotGit - 🐚 shell aliases + 🪄 dotfiles + 🧸 bare git repo","archived":false,"fork":false,"pushed_at":"2025-02-16T02:55:36.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T03:19:40.854Z","etag":null,"topics":["dotfiles","dotfiles-installer","dotfiles-manager","fzf","fzf-wrapper","git"],"latest_commit_sha":null,"homepage":"https://github.com/opennomad/dotGit","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opennomad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-16T02:06:54.000Z","updated_at":"2025-02-16T02:55:39.000Z","dependencies_parsed_at":"2025-02-16T03:29:47.929Z","dependency_job_id":null,"html_url":"https://github.com/opennomad/dotGit","commit_stats":null,"previous_names":["opennomad/dotgit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennomad%2FdotGit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennomad%2FdotGit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennomad%2FdotGit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennomad%2FdotGit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opennomad","download_url":"https://codeload.github.com/opennomad/dotGit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239373169,"owners_count":19627784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotfiles","dotfiles-installer","dotfiles-manager","fzf","fzf-wrapper","git"],"created_at":"2025-02-17T22:16:11.635Z","updated_at":"2026-04-11T02:03:14.065Z","avatar_url":"https://github.com/opennomad.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotGit ::: 🪄 dotfiles + 🧸 bare git repo + 🐚 shell aliases\n### a minimal and effective approach to dotfiles (and git repos)\n\n[![ShellCheck](https://code.opennomad.com/opennomad/dotGit/actions/workflows/shellcheck.yml/badge.svg)](https://code.opennomad.com/opennomad/dotGit/actions?workflow=shellcheck.yml)\n\nmirrors: [Codeberg](https://codeberg.org/opennomad/dotGit) · [GitHub](https://github.com/opennomad/dotGit)\n\nDotfiles are scattered across `$HOME`. Can't remember where you set the `PATH`, or where you defined that alias three months ago?\n\n`.gg PATH` greps across every tracked dotfile and drops you straight to the line.\n\n`.ge` fuzzy-finds any file by name with a live preview.\n\nUnder the hood it's a [bare git repo](https://news.ycombinator.com/item?id=11070797), so files stay exactly where tools expect them and everything else is standard git behind some aliases.\n\nBonus: set `DOTGIT_ANYGIT=yes` and the same gg/ge aliases (without the leading dot) work across all your repos.\n\n![dotGit demo](demo/demo.gif)\n\n## TL;DR\n\n```bash\n# 1. in your .zshrc or .bashrc:\nexport DOT_REPO=\"${HOME}/.dotfiles\"\nexport DOT_HOME=\"${HOME}\"\nexport DOT_ORIGIN=\"git@github.com:user/dotfiles.git\"  # optional\nsource /path/to/dotgit.sh\n\n# 2. initialize a new repo, or clone an existing one\n.ginit        # new repo\n.gclone       # clone from DOT_ORIGIN\n\n# 3. daily use\n.ge zshrc     # fuzzy-find and edit files matching \"zshrc\"\n.gg PATH      # grep across dotfiles, jump to result\n.gss          # status\n.ga .zshrc    # stage a file\n.gc -m 'msg'  # commit\n.gp           # push\n```\n\n## usage\n\n### .ge — fuzzy find and edit\n\n`.ge` opens a fuzzy file finder across all tracked dotfiles. Type to narrow by filename, and get a live syntax-highlighted preview of each file on the right. Select one or more files and they open in `$EDITOR`.\n\n```\n.ge            # browse all dotfiles\n.ge zsh        # pre-filter to files with \"zsh\" in the name\n```\n\n### .gg — grep and jump\n\n`.gg` runs `git grep` across all tracked dotfile contents and presents the matches interactively. Select a result and your editor opens directly at that line.\n\n```\n.gg PATH       # find every place PATH is set or referenced\n.gg 'alias g'  # find all git aliases\n```\n\nEverything else is a standard git alias pointed at the dotfiles repo.\n\n### a normal workflow for making configuration changes\n\n1. `.gl` - pull changes from origin\n2. make some changes. Try:\n    - `.ge zshrc` - presents all files with `zshrc` in the name\n    - `.gg PATH` - runs `git grep` across your dotfiles and presents the results\n3. `.gc -m 'commit comment' .zshrc` - will commit the changes\n4. `.gp` - pushes the changes to the origin\n\n### a list of all aliases defined\n\n\n| alias | action | note |\n| --- | --- | --- |\n| .git | `git --git-dir=${DOT_REPO} --work-tree=${DOT_HOME}` | |\n| .g | `.git` | |\n| .ga | `.git add` | |\n| .gc | `.git commit`  | |\n| .gco | `.git checkout`  | |\n| .gd | `.git diff` | |\n| .gds | `.git diff --stat` | |\n| .ge | fuzzy find and edit dotfiles [^fzf] | |\n| .gg | grep dotfiles and open at the matched line [^line] [^fzf] | falls back to `.git grep` without fzf |\n| .gss | `.git status --short` | |\n| .glo | `.git log --oneline --decorate`  | |\n| .glg | `.git log --stat`  | |\n| .glgp | `.git log --stat --patch` | |\n| .gbl | `.git blame -w` | |\n| .gb | `.git branch` | |\n| .gba | `.git branch --all` | |\n| .gbd | `.git branch --delete` | |\n| .gbD | `.git branch --delete --force` | |\n| .gm | `.git merge` | |\n| .gma | `.git merge --abort` | |\n| .gmc | `.git merge --continue` | |\n| .gc! | `.git commit --verbose --amend` | |\n| .gcm | `.git commit --message` | |\n| .gcp | `.git cherry-pick` | |\n| .gcpa | `.git cherry-pick --abort` | |\n| .gcpc | `.git cherry-pick --continue` | |\n| .gclean | `.git clean --interactive -d` | |\n| .gp | `.git push` | requires `DOT_ORIGIN` be set |\n| .gl | `.git pull` | requires `DOT_ORIGIN` be set |\n| .lazygit | `lazygit -g ${DOT_REPO}/ -w ${DOT_HOME}` | requires `lazygit` be installed |\n| .gitui | `gitui -d ${DOT_REPO}/ -w ${DOT_HOME}` | requires gitui to be installed |\n| .gclone | `git clone --bare \"${DOT_ORIGIN}\" \"${DOT_REPO}\"; .git config --local status.showUntrackedFiles no` | [^untracked] |\n| .ginit | `git init --bare \"${DOT_REPO}\"; .git config --local status.showUntrackedFiles no`   |   |\n\n[^line]: Opens the editor with `+line file` arguments. Works with vi, emacs, nano, micro, and any editor that accepts `+N`. For vim/nvim multi-file line jumping set `DOTGIT_OPEN_FMT='+e {file}|{line}'` (note: literal `|`, not `\\|`).\n[^untracked]: Also set git's `status.showUntrackedFiles` to `no`. This prevents every file in `$DOT_HOME` from showing as \"untracked\" by git.\n[^fzf]: requires [FZF](https://github.com/junegunn/fzf)\n\n## requirements\n\n- `EDITOR` set to your liking \n- [git](https://git-scm.com/)\n- [bat](https://github.com/sharkdp/bat) (optional, default preview command)\n- [fzf](https://github.com/junegunn/fzf) (optional)\n- [lazygit](https://github.com/jesseduffield/lazygit) (optional)\n- [gitui](https://github.com/extrawurst/gitui) (optional)\n\n## installation\n\n1. clone this repository or simply copy the [dotgit.sh](./dotgit.sh)\n2. add some configuration sauce to your shell initialization (.i.e. `.zshrc` or `.bashrc`). The `DOT_REPO` and `DOT_HOME` variables **must be set** for the dotgit.sh to load!\n  ```bash\n  export DOT_REPO=\"${HOME}/.dotfiles\"   # this is where the repo will live\n  export DOT_HOME=\"${HOME}\"             # this is generally the same as `$HOME`\n  export DOT_ORIGIN=\"git@github.com:user/your-dotfiles-repo.git\"   # optional\n  source \u003cpath to dotGit.sh\u003e\n  ```\n3. restart your shell or `source ~/.zshrc` or `source ~/.bashrc`\n4. run `.ginit` to start a new repo, or `.gclone` to clone an existing one\n    - if cloning: `.gco \u003cbranch\u003e` to checkout your config files (see *initial clone cleanup* below if files conflict)\n    - if initializing: start tracking files with `.ga`\n\n## configuration\n\n`DOT_REPO` and `DOT_HOME` must be set before sourcing `dotgit.sh`. All other variables are optional.\n\n| variable | default | description |\n| --- | --- | --- |\n| `DOT_REPO` | *(required)* | path to the bare git repository |\n| `DOT_HOME` | *(required)* | work tree root, usually `$HOME` |\n| `DOT_ORIGIN` | *(unset)* | remote URL; enables `.gp`, `.gl`, and `.gclone` |\n| `DOTGIT_PREVIEW` | `bat -p --color=always` | fzf preview command |\n| `DOTGIT_MULTI_LIMIT` | `5` | max files selectable at once in `.ge` and `.gg` |\n| `DOTGIT_OPEN_FMT` | `split` | how `.gg` passes file+line to the editor; `split` uses `+line file` (works with most editors); set to `+e {file}\\|{line}` for vim/nvim multi-file line jumping |\n| `DOTGIT_ANYGIT` | *(unset)* | set to `yes` to also load unprefixed `g*` aliases for any git repo |\n| `DEBUG` | *(unset)* | set to any value to print load/unload messages |\n\n### ANYGIT\n\nSetting `DOTGIT_ANYGIT=yes` causes dotGit to source a transformed copy of itself that registers a parallel set of aliases without the leading `.` — so `.ga` becomes `ga`, `.gc` becomes `gc`, etc. These work against whichever git repo your shell is currently in, like ordinary git aliases. Yes, `ge` and `gg` are included.\n\n## initial clone cleanup\n\nExisting configuration files will prevent checking out the files. To list the files causing the checkout to fail, run the following.\n\n```bash\n.g checkout 2\u003e\u00261|grep -E '^\\s'|cut -f2-|xargs -I {} echo \"{}\"\n```\n\nTo remove all the conflicting files, simply change the `echo` in the above command to `rm`. **This will delete files, so be sure you want to remove them.** Once the files are removed the checkout will succeed.\n\n## future features\n\n- command line completion\n- manage system configuration files\n\n## alternatives\n\n- [GNU Stow](https://www.gnu.org/software/stow)\n- [dotbare](https://github.com/kazhala/dotbare) (this is close in spirit to dotGit, and can be used together with dotGit from what I can tell)\n- [Home Manager](https://github.com/nix-community/home-manager)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennomad%2Fdotgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennomad%2Fdotgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennomad%2Fdotgit/lists"}