Organize your development environment when you are using tmux & vim for software development
- git clone firstname.lastname@example.org:gigorok/worktree.git
- ln -s worktree/bin/worktree ~/.bin/worktree
- configure your shell to make ~/.bin folder be available in $PATH
- prepare your existing repo
Prepare your repo
Let's assume you have a git repo (at master branch) by path ~/projects/YOUR_REPO_NAME/.git. Then you have to have the next folder structure ~/projects/YOUR_REPO_NAME/master/.git.
To create a new worktree folder go to ~/projects/YOUR_REPO_NAME & run command
worktree new new-feature.
- Worktree will create a new folder (new-feature) inside ~/projects/YOUR_REPO_NAME (following git worktree feature).
- Copy nessessary development config files.
- If you are using Rails then worktree will ask you about creation of clone of your development database (if master/config/database.yml exists).
- Run tmux inside of ~/projects/YOUR_REPO_NAME/new-feature along with VIM
The file should be present in ~/projects/YOUR_REPO_NAME folder. This is a plain text file with list of files which should be copyied to the new worktree folder. Example: