Bare repositories should not have a working tree, so git displays the error message "fatal: core.bare and core.worktree does not make sense." Therefore, you need to set bare = false in the repo configuration file.
user@host :~$ cd barerepo user@host :~/barerepo$ git config --bool core.bare false user@host :~/barerepo$ git config --path core.worktree /var/www/mywork
However, if barerepo did not exist before, you should use this command:
git init --separate-git-dir=. /var/www/mywork
This command will also create a .git file in the work tree, pointing to the git directory:
gitdir: /home/user/barerepo
PleaseStand
source share