In brief TLDR
To rsync a folder that has .git/ excluded but still keeping the .git/config file, how to do that?
My google search is not helpful so I asked here.
Full details
I want to take snapshot of all of my projects' code into another machine - later on I may not have the git repo access.
Each project code folder is a git-cloned one so they have .git folder.
I don't need those .git so will exclude them.
But I need to know what git repo the projects coming from so need to keep .git/config.
What I tried and didn't work run it
rsync -chazvP --dry-run --exclude=".git" --include=".git/config" $FROM/ $TO/
# . . . . .
If you know the correct way to do so, please share.
exclude .git/
the whole folder excluded and now we want tokeep .git/config
, how to? @gronostaj