-
Notifications
You must be signed in to change notification settings - Fork 19
Commands
Running dotbare
without any arguments will display all available f
scripts.
-
-h, --help
: display the help manual fordotbare
. -
-v, --version
: print the version number ofdotbare
. -
-g, --git
: usedotbare
as a generic fuzzy git client,dotbare
will dynamically determine the top level.git
folder and all commands (dotbare fadd
,dotbare flog
etc) will perform action in the current work tree (i.e. current git directory).
Select files/commits through fzf and edit selected files/commits in $EDITOR. Editing commits will perform a interactive rebase.
- Default: list all tracked files and open $EDITOR to edit the selected files. Support multi selection.
-
-h, --help
: show the help message ofdotbare fedit
and exit. -
-m, --modified
: list all modified files and open $EDITOR to edit the selected files. Support multi selection. -
-c, --commit
: list all commits and edit the selected commit through interactive rebase.
Select files/directories or modified files through fzf and stage the selected files/directories.
- Default: list all modified files and stage selected files. Support multi selection.
-
-h, --help
: show the help message ofdotbare fadd
and exit. -
-f, --file
: list all files in current directory and stage selected files. Support multi selection. (Used for staging new files to index). -
-d, --dir
: list all directory under current directory and stage selected directory. Support multi selection. (Used for staging new files to index).
Select staged files or commits through fzf and then reset(unstage) staged files or reset HEAD back to certain commits.
Also supports reset HEAD back to certain commits using either --soft
, --hard
, --mixed
flags.
More information on differences between flags here.
- Default: list all staged files and unstage the selected files. Support multi selection.
-
-h, --help
: show the help message ofdotbare freset
and exit. -
-c, --commit
: list all commits and then reset HEAD back to the selected commits. (Default:--mixed
, put all changes into modified state). -
-S, --soft
: use--soft
flag instead of--mixed
flag, reset HEAD to certain commit without modifying working tree. -
-H, --hard
: use--hard
flag instead of--mixed
flag, reset HEAD to certain commit discard all changes from the working tree. -
-y, --yes
: acknowledge all actions that will be taken and skip confirmation.
Checkout files/commit/branch interactively through fzf.
- Default: list all modified files and reset selected files back to HEAD. Support multi selection. (Discard all changes) Note: if your file is staged, you will need to unstage first before running fcheckout to make it work.
-
-h, --help
: show the help message ofdotbare fcheckout
and exit. -
-s, --select
: list all tracked files and select a commit to checkout the selected files. Support multi selection. -
-b, --branch
: list all branch and switch/checkout the selected branch. -
-c, --commit
: list all commits and checkout selected commit. -
-y, --yes
: acknowledge all actions that will be taken and skip confirmation.
Interactive log viewer that will prompt you with a menu after selecting a commit. The action menu contains options including edit, reset, revert and checkout the selected commits.
- Default: list all commits and then prompt menu to select action to perform.
-
-h, --help
: show the help message ofdotbare flog
and exit. -
-r, --revert
: revert the selected commit and skip action menu. -
-R, --reset
: reset HEAD back to the selected commit and skip action menu. -
-e, --edit
: edit selected commit through interactive rebase and skip action menu. -
-c, --checkout
: checkout selected commit and skip action menu. -
-y, --yes
: acknowledge all actions that will be taken and skip confirmation.
View and manage stash interactively.
- Default: list all stashes and apply the selected stash. (Default:
apply
). -
-h, --help
: show the help message ofdotbare fstash
and exit. -
-s, --select
: list modified files and stash the selected files. Support multi selection. -
-d, --delete
: list all stashes and delete selected stash. Support multi selection. -
-p, --pop
: usepop
instead ofapply
. (pop
would remove the stash whileapply
preserve the stash).
Grep words within tracked files and select to edit them through fzf. The words are listed as lines in fzf and is separated by columns. First column is the file name, second column is the line number and the third column and beyond are the content of the lines.
- Default: start searching from 3rd column (excluding the file name and line number during search).
-
-h, --help
: show the help message ofdotbare fstat
and exit. -
-c COL, --col COL
: specify the column number to start searching (e.g.dotbare fgrep --col 2
). -
-f, --full
: include all column during search, as if using--col 1
.
Backup files to $DOTBARE_BACKUP directory. This is particular useful when untracking files
or migrating to new machines. This is used by dotbare finit -u [URL]
for backing up conflicted checkout files.
- Default: backup all tracked files to $DOTBARE_BACKUP directory. (Default: use
cp
command). -
-h, --help
: show the help message ofdotbare fbackup
and exit. -
-s, --select
: list all tracked files and only backup the selected files. Support multi selection. -
-p PATH, --path PATH
: specify path to files to backup. (This is mainly used bydotbare finit -u [URL]
). -
-m, --move
: usemv
instead of the defaultcp
command to backup. (This is mainly used bydotbare finit -u [URL]
).
Display interactive git status menu. Toggle file stage/unstage status interactively.
-
-h, --help
: show the help message ofdotbare fstat
and exit.
Initialise dotbare with a bare repository or add -u [URL] flag for migrating existing dotfiles from remote git repo to current system.
Note: do not use this command if you are using symlink/GNU stow and want to keep your current setup.
- Default: init the bare repository at $DOTBARE_DIR.
-
-h, --help
: show the help message ofdotbare finit
and exit. -
-u URL, --url URL
: migrate existing dotfiles from remote git repo to current system. -
-s, --submodule
: if you have defined submodules in your bare repo (i.e. containes .gitmodule), add -s flag to clone submodules as well during migration. -
-y, --yes
: acknowledge all actions that will be taken and skip confirmation.
Stop tracking the selected git files. It could also be used to temporarily stop tracking changes for files and then later on resume tracking changes.
Note: This command has severe limitations.
By default, selected files are permanently untracked from git. Selected files will be
remove from index while keeping the file in your current system. However, when your other
machines pull down the changes, the untracked files will be deleted by git. This is a limitation
with git, to overcome this, after untracking the files, run dotbare fbackup
to backup all files on
other machines before pulling down the changes to avoid any file loss.
After pulling new changes, move the deleted files from backup back to their original position.
More discussions here.
dotbare funtrack
does come with capabilities to temporarily untrack files, which will not
remove the untracked files from other system. However, this is NOT recommended
way to untrack files, explained here.
- Default: list all tracked files and permanently untrack the selected files. Support multi selection.
-
-h, --help
: show the help message ofdotbare funtrack
and exit. -
-t, --temp
: list all tracked files and temporarily untrack changes of the selected files. Support multi selection. -
-r, --resume
: list all tracked files and resume tracking changes of the selected files. -
-y, --yes
: acknowledge all actions that will be taken and skip confirmation.
Update dotbare to the latest master. It will perform a git pull --rebase --stat
and also
performing a auto-stash if needed (copied the method from OMZ). This is useful if you are not
using a plugin manager.
-
-h, --help
: show the help message ofdotbare fstat
and exit.