As in the title, how can I backup completely a local Git repository and its state, restore it on another machine, and have the new repository to be in the exact state as the one on the previous machine?
I mainly care to not loose local stuff, like:
- stashes (that's the most important thing)
- reflog (I want to keep my operations history)
- notes
- all the rest (possibly)
EDIT
I already tried to compress my local directory, including hidden files like .git
, and restore it on the other machine.
What I get, after that, with git status
is:
- a HUGE list of changed files (and I don't recognize the changes)
- the repository is in a detached HEAD
If everything is in the .git
folder, why I get the HEAD detached and I don't get the same pointing of the old repository?
And what are all these modified/deleted/typechanged files?
It seems that .git
is not really taking everything from the old repository.