expman
expman copied to clipboard
ExpMan
๐ฝ๏ธ ExpMan is a handy experiment management tool based on git-worktree.
Key features
- ๐ฑ Work on multiple git branches in parallel
- ๐ ๏ธ A set of commands to easily create, fork, checkout and push branches
- ๐ Integration with fzf, find target in 1 second and jump among 1000+ branches
Why ExpMan?
In machine learning and other experimental sciences, engineers often need to run multiple experiments simultaneously in order to efficiently search for parameters and validate hypotheses.
Using Git branches to manage experiments can be very helpful for code comparison and quickly jumping between experiments.
However, simple usage of the git-branch
and git-checkout
commands can only allow working on a single branch at a time.
Git-worktree is a great solution for working on multiple branches simultaneously, but with the number of experiments ๐ potentially reaching into the hundreds or thousands in a short period of time, ๐คฏ engineers can easily lose themselves.
ExpMan provides a set of handy commands that not only allows beginners to quickly master parallel operations on multiple branches, but also integrates the incredibly useful fzf for fuzzy searching ๐ among thousands of branches, enabling engineers to quickly find their desired experiments and significantly improving their efficiency in scientific research.
Installation
Currently Only Zsh is supported
- Install fzf
- Download ExpMan
git clone https://github.com/megvii-research/expman $HOME/.expman
- Load ExpMan by adding one line in
~/.zshrc
echo '[[ -o interactive ]] && source $HOME/.expman/expman.zsh' >> ~/.zshrc
Get Started
๐๏ธ Create a new repository
# create project
em init <project-name>
# go to project
cd <project-name>
๐งช Create an empty experiment
# create an experiment, but stay at where you were
em new empty <my-experiment-name>
# create an experiment, and go to the new experiment dir
em new -c empty <my-experiment-name>
๐ Goto some experiment
em cd <experiment-name>
๐ Fork existing branch to new
# create an experiment, but stay at where you were
em new <old-experiment> <new-experiment>
# create an experiment, and go to the new experiment dir
em new -c <old-experiment> <new-experiment>
๐ฅ Checkout a branch
If you clone a repository at a new location, or you have co-workers pushed their experiments to remote
git fetch # sync with remote
em checkout remotes/origin/<experiment-name>
๐ค Push to remote
em push <experiment-name>
๐๏ธ Delete a local branch
em delete <experiment-name>
Note: Only local branch is deleted, to delete a remote branch, use native git command, or simply use your git-web UI like GitHub.
git push <remote> :<branch-name>
๐ Integrate with fzf
Press <TAB>
following em
commands, and magic happens.
em new # press <TAB>
em cd # press <TAB>
em checkout # press <TAB>
LICENSE
Apache License 2.0