track a file with git repo as well as separate git bare repo

31 Views Asked by At

I use to manage my dotfiles with a git bare repository. However some of my dotfiles are already in git repositories existing for a long time. I dont want to lose all the change history so I would prefer keeping the repo.

When I try to add those files into my git bare repository git seems to ignore them. Is there any way to have the same file in two different repos (one a local git repo and one a git bare repo)?

Best regards

I did git --git-dir=/home/user/.dotfiles --work-tree=$HOME add localrepo/file and expected the file localrepo/file to be staged.

localrepo is a git repository itself and nothing happened. If I do the same for files which are not in git repositories everything happens as expected

0

There are 0 best solutions below