- Initialise a normal Git repo in the directory you want to sync.
- Then, initialise a bare Git repo in an arbitrary Git folder:
git init --bare ~/git/(project name).git - Then, in the normal Git repo, add the bare Git repo as a remote:
git remote add (remote name) "$HOME/git/(project name).git" - Finally, push from the normal Git repo to the bare Git repo:
git push -u (remote name) main
# init a new empty git repo.
usr@host:~/Projects/NS-Ticket-Fetcher$ git init .