I am trying to write some end-to-end tests for my lab's codebase. My initial idea was to iterate through every commit on master
(i.e. every version of the program)
for commit in $(git rev-list master | head)
do
rm -rf build
git checkout -b "${commit}" ${commit}
#do tests, etc.
done
but this method gets pretty messy when I start moving files between different branches. My new idea is to copy the contents of each separate version (commit) into a separate directory, such that the directory structure would look like
all_versions/ │
├── commit_0 │
├── commit_1 │
└── commit_2
Is there a git
command that I can use to cleanly copy the contents of an entire commit into a directory?