将.vim〜/ .vimrc添加到github(又名点文件) [英] Adding your .vim ~/.vimrc to github (aka dot files)

查看:253
本文介绍了将.vim〜/ .vimrc添加到github(又名点文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有几个人使用他们的点文件进行git回购。我想知道他们是否只是

  cd〜/ 
git init
git add .vimrc
// etc

?那么这就是他们如何保持最新?或者他们可能会复制并同步它们?

你们推荐或使用什么策略?大多数情况下不希望提交并推送我的全部内容〜/



谢谢

解决方案

制作一个你家的git仓库可能是一个坏主意(你会花更多的时间来创建.gitignore文件,而不是做你真正想做的事情)。



我建议为你的dotfiles使用一个单独的git目录(例如〜/ git / dotfiles ),并且它们将符号链接到你的家里(例如 ln -s〜/ git / dotfiles / .vim〜/ .vim 等)。



如果你不能打扰每次你想在某处安装你的点文件时手动创建符号链接,你可以使用如下的脚本: https://github.com/sitaktif/dotfiles/blob/master/bin/create-symlinks (它使用 https://github.com/sitaktif/dotfiles/blob/master/CONFIG.ex充足的作为配置)。


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 ~/

Thanks

解决方案

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).

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.).

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/sitaktif/dotfiles/blob/master/bin/create-symlinks (it uses https://github.com/sitaktif/dotfiles/blob/master/CONFIG.example as the configuration).

这篇关于将.vim〜/ .vimrc添加到github(又名点文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆