简体   繁体   中英

Limit recursivity of a git repository

I have created a git repository on my home directory (/home/user/.git) to "backup" and save alle changes from my dotfiles.

To solve this I have implmeneted a gitignore where I explicit ignore all files excepting the wanted dotfiles.

But know I can access the git repository from everywhere (home/user/folder1, home/userfolder2) - Can I limit the recursivity from a git repository, so only the directory /home/user is under vcs?!

Thanks in advance!

Symlinking the dotfile is one solution.
I mentioned before in " One git for multiple folders in differents places " the project vcsh : one git repo for your different configs, but:

vcsh allows you to maintain several Git repositories in one single directory. They all maintain their working trees without clobbering each other or interfering otherwise.

See an example in " Managing dot-files with vcsh and myrepos ", and vcsh presentation in " GitMinutes #13: Richard Hartmann on Managing Your Homedir with vcsh "

That is another approach to trying to have a repo directly in one's $HOME (having to exclude any subfolder).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM