Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: example aliases for use with git repo #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ interactive experience. It is originally inspired by [forgit](https://github.com
of the flexible implementation of `dotbare`, it can easily integrate with symlink/GNU stow setup or even as a generic
fuzzy git client to use in any git repository.

As a generic fuzzy git client (using `--git` flag), `dotbare` dynamically determine the top level `.git` folder and process git information
and perform git operation in the current working tree.
As a generic fuzzy git client (using `--git` flag), see [Use it with any git repo](#use-it-with-any-git-repo).

You could find out how git bare repository could be used for managing dotfiles [here](https://www.atlassian.com/git/tutorials/dotfiles).
Or a [video](https://www.youtube.com/watch?v=tBoLDpTWVOM&t=288s) explanation that helped me to get started. If you are currently
Expand Down Expand Up @@ -203,6 +202,36 @@ it will require you to have bash in the system (You don't need to run bash, just
dotbare push -u origin master
```

### Use it with any git repo

`dotbare` can dynamically determine the top level `.git` folder if you pass the
`--git`/`-g` flag, allowing to perform git operations in the current working tree.

```sh
dotbare -g flog
```

for better ergonomics, add the following [git aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases)

```gitconfig
# ~/.config/git/config
[alias]
# ...
fuzzy = !dotbare -g
fedit = fuzzy fedit
fgrep = fuzzy fgrep
flog = fuzzy flog
fstat = fuzzy fstat
# ...
```

now you can use it directly

```sh
git fuzzy # use <tab> to see all available commands
git flog
```

### Migration

#### Migrating from normal git bare repository
Expand Down