git - How can I cache untracked (binary) files associated to a branch? -
assume 1 of many developers working git on huge code project, has incredibly long compilation time.
now, personal day-to-day changes limited, , codebase decently modular, means far personal work concerned, compiling scratch price has paid once. afterwards, can recompile modules modified.
on other hand, i have fix bugs in (at least two) branches reflect states of codebase distinct branch work on. 2 branches indeed result of work entire development team, , have entire modules rewritten or added. having compiled before pushing bugfix mandatory.
my first approach switch development branch every time bugfix needed, clean, bugfix, recompile scratch, push, switch original branch, clean again, recompile - the delay doing intolerable.
i moved keeping 3 separate checkouts of codebase on machine. solves "costly recompilation" problem (my changes in every branch incremental again), makes question "what developing on right ?" more complex answer (since depends on current directory), , makes synchronization of these 3 copies complex (it multiplies routine push
/remote update
/pull
commands have three).
a simpler solution to have ability save state of directory (untracked, generate compiled files) every time checkout "leaves"a branch, , recall state of directory, if exists, every time "enter" (checkout) a branch.
- are there git commands me achieve behavior ?
- if not, there tool allow me ?
- if not, git provide checkout hooks me script behavior ?
i suggest use stashes, pretty close need.
in recent versions of git, can stash untracked files --include-untracked
option. can give messages stashes , recall them, can check in stash must applied after checking out branch.
#before leaving branch git stash save --include-untracked "compiled stuff my_branch" git checkout another_branch #what stash contains compiled stuff another_branch? git stash list git stash pop stash@{n}
you can script bit make things more practical...
Comments
Post a Comment