将您的 .vim ~/.vimrc 添加到 github(又名点文件) [英] Adding your .vim ~/.vimrc to github (aka dot files)
问题描述
我见过一些人将 git repos 与他们的点文件.我想知道他们是否只是
I have seen a few people that have git repos with their dot files. I'm wondering if they just
cd ~/
git init
git add .vimrc
// etc
?然后这就是他们保持最新的方式?或者他们可能会复制并同步它们?
? And then that's how they keep it up to date? Or do they probably make copies and sync them?
你们推荐或使用什么策略?主要是不想提交并推送我的整个 ~/
What strategy do you guys recommend or use? Mostly don't wanna commit and push my entire ~/
谢谢
推荐答案
为你的家建立一个 git 存储库可能是一个坏主意(你会花更多的时间来创建你的 .gitignore 文件而不是做你真正想做的事情).
Making a git repository of your home is probably a bad idea (you would be spending more time creating your .gitignore file than on doing what you really want to do).
我建议为您的 dotfiles 使用单独的 git 目录(例如 ~/git/dotfiles
),并且它们会创建指向您家的符号链接(例如 ln -s ~/git/dotfiles/.vim ~/.vim
等).
I suggest using a separate git directory for your dotfiles (eg. ~/git/dotfiles
) and them making symlinks to your home (eg. ln -s ~/git/dotfiles/.vim ~/.vim
, etc.).
如果每次想要在某处安装点文件时都不想手动创建符号链接,可以使用如下脚本:https://github.com/gibfahn/dot/blob/master/link.
If you can't be bothered creating symlinks manually each time you want to install your dotfiles somewhere, you can use a script like the following one: https://github.com/gibfahn/dot/blob/master/link.
这篇关于将您的 .vim ~/.vimrc 添加到 github(又名点文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!