I know how to add all files from current directory
git add .
git add . ~/local-repo/
You’re looking for the -C
option:
git -C ~/local-repo/ add .
From the manpage:
-C <path>
Run as if git was started in <path> instead of the current working directory.
It allows you to perform actions on a git repository as if you were in it.