I have been using Git for a while now. The projects that I have been working on have not been too complicated in regards to branches/tags.
Okay
So this question has been unanswered for a while now and I just been trying different solutions locally.
The best one I came up with is to use pre amd post checkoout hooks.
Here is what I have done
Create a .binaries
folder at the top level of your repository and add it to the .gitignore
file.
Add the file formats of the binaries to your .gitignore
file also.
write a script in your favorite scripting language to find all files of said format that moves them to the .binaries/
folder under the same path structure e.g. src/library1/lib1.o
should be MOVED to .binaries/
- this should be called by pre-checkout
Write a script to move files from the .binaries
folder into the current branch e.g. .binaries/
should be MOVED to src/library1/lib1.o
- this should be called by post-checkout
Now switching between branches will revert to the binaries that were built during for that branch only and you will have a clean checkout when creating a new branch.