I am backing up my hard drive of my project repos. I have a lot of work so I wanted to back them up on a SSD. When I just copied them, in the console, it showed a completely clean history. I wanted to essentially clone the repo but also keep my git history so it is an replica of what I have on my machine, with all of my commits in tact.
I looked into this solution here: How to move files from one git repo to another (not a clone), preserving history
I wanted to try taking out the commits as a patch. Of the best and simplest solutions was
cd repository
git log --pretty=email --patch-with-stat --reverse --full-index --committer-date-is-author-date --binary -- path/to/file_or_folder > patch
cd ../another_repository
git am < ../repository/patch
Am I going about this the right way? or is there a better way to do this?