如何使用Github来管理点文件? [英] How to use Github to manage dotfiles?
问题描述
我将自己的dotfiles存储在github中,因为没有自动化,所以很多痛苦。我必须自己更新它。
有没有办法可以自动安装/更新/同步dotfiles?我的意思是在一台全新的服务器中,我下载dotfiles并执行 install
脚本将dotfiles复制到本地。一段时间后,我可以执行一个 updateToRemote
脚本来将本地更改推送到远程仓库,并且在另一台服务器上,我可以执行 updateToLocal
脚本将远程更改拉到本地。
类似的东西。
关于dotfiles的主要信息来源是 dotfiles.github.io
。
它引用博文,如使用Git和Github管理你的点文件,基于符号链接方法。
首先,我们将所有的点文件进入名为dotfiles的文件夹,如下所示:
/ home / smalleycreative / dotfiles / vimrc
。
然后,我们将简单地从我们的家目录。
Jaime 提到了Atlassian教程存储你的点文件的最佳方式:一个纯粹的Git仓库
包括在一个side文件夹(如
$ HOME / .cfg
或$ HOME / .myconfig $ c $)中存储Git裸存储库c>)使用特制的别名,以便针对该存储库运行命令,而不是通常的
.git /
本地文件夹,这会干扰任何其他Git存储库。
(然后将dotfiles文件夹作为git repo进行管理)
I stored my dotfiles in github, with lots pains, because of no automation. I have to update it myself.
Is there a way that can auto install/update/sync dotfiles? I mean in a fresh server, I download dotfiles and exec a install
script to copy dotfiles to local. After some time, I can exec a updateToRemote
script to push local changes to remote repo, and on another server, I can exec a updateToLocal
script to pull remote changes to local.
Something like that.
The main source of information about dotfiles is dotfiles.github.io
.
It references blog posts like Using Git and Github to Manage Your Dotfiles, based on a symlink method.
For starters, we’ll be putting all of our dotfiles into a folder called dotfiles, like so:
/home/smalleycreative/dotfiles/vimrc
.
Then, we’ll simply symlink to them from our home directory.
Jaime mentions the Atlassian tutorial "The best way to store your dotfiles: A bare Git repository"
The technique consists in storing a Git bare repository in a "side" folder (like
$HOME/.cfg
or$HOME/.myconfig
) using a specially crafted alias so that commands are run against that repository and not the usual.git/
local folder, which would interfere with any other Git repositories around.
(and then the dotfiles folder is managed as a git repo)
这篇关于如何使用Github来管理点文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!