3 Several naive `(ba)sh`-shortcuts for `git worktree` subcommand.
7 Creation of `git` worktrees and switching between them is quite verbose thing to do for my regular use-cases. `git-wtree` is intended to simplify this routine.
8 This one is a simple shell script supposed to be sourced inside of a shell. It was intentionally developed in a shell-agnostic way (no bashishm's are used) but tested with `bash` only and `git` 2.18.0.
12 Inside of `~/.bashrc`:
14 # The comment for the line below could be removed to establish short aliases for provided commands
15 # GIT_WTREE_ALIAS_ENABLED=true
17 . git-wtree/git-wtree.sh
21 Inside of `git` repository where worktrees are supposed to be intensively used:
23 git config --local worktree.root <ROOT_DIR>
25 where `<ROOT_DIR>` is a directory where all worktrees are created and removed from.
29 git_wtree_cmd_new --name <BRANCH_NAME> --dir <DIR>
32 git.wtree:ls --name <BRANCH_NAME> --dir <DIR>
36 - `<BRANCH_NAME>` is name of the branch to be created;
37 - `<DIR>` is name of directory inside of `<ROOT_DIR>`
39 vs native `git worktree add -b <BRANCH_NAME> <ROOT_DIR>/<DIR>`.
44 git_wtree_cmd_drop --name <BRANCH_NAME>
46 git.wtree:drop --name <BRANCH_NAME>
49 where `<BRANCH_NAME>` is a name of the branch to be deleted.
51 vs native `git worktreee remove <FULL_PATH_TO_DIR_OF_BRANCH_NAME>`
53 ### List branches inside worktrees
59 vs native `git worktree list` and futher grepping for a branch name.
61 ### Switch to a worktree dir
63 git_wtree_cmd_tool_cd <BRANCH_NAME>
65 git.wtree:cd <BRANCH_NAME>
67 git_wtree_cmd_tool_pushd <BRANCH_NAME>
69 git.wtree:pushd <BRANCH_NAME>
71 vs native `git worktree list`, grepping and furhter cd/pushd execution.