Iterate on config#
When making changes which will likely break the config temporarily, use git
worktrees to keep both the current version and the in-flux version available
for use.
This is also the default setup, where the config is cloned as a bare repo at
~/.config/neovim-config.git/bare.
git clone github:vvnraman/neovim-config.git --bare ~/.config/neovim-config.git/bare
cd ~/.config/neovim-config.git/bare
git worktree add ~/.config/nvim dev
git worktree add ~/.config/neovim-config.git/master master
The active branch is checked out at ~/.config/nvim, in this case the
dev branch.
Making minimal changes#
During steady state, when no changes are happening, or minimal changes are being made.
cd ~/.config/nvim
git switch -c spring-clean
Major refactoring#
First make sure master is available as an alternate config, before doing any
refactor.
Make sure no uncommitted changes are present in
~/.config/nvimcd ~/.config/nvim git status
Make sure
masteris checked out at~/.config/neovim-config.git/master(add it if missing)cd ~/.config/neovim-config.git/bare git worktree list git worktree add ~/.config/neovim-config.git/master master
Make an
mvimfunction (mformasterbranch)Create a new worktree for the refactor branch and leave
~/.config/nvim(dev) untouchedcd ~/.config/neovim-config.git/bare git worktree add -b holiday-update ~/.config/neovim-config.git/holiday-update dev
Do the refactor in
~/.config/neovim-config.git/holiday-updateValidate changes using Test in Docker
Fast-forward merge
holiday-updateintodevonce satisfiedcd ~/.config/nvim git status git merge-base --is-ancestor dev holiday-update git merge --ff-only holiday-update
Remove temporary refactor worktree and branch after merge
cd ~/.config/neovim-config.git/bare git worktree remove ~/.config/neovim-config.git/holiday-update git branch -d holiday-update