大家推荐把哪些配置文件放 Git 里?

2021-11-27 00:02:24 +08:00
 ryougifujino

这几天新 Mac 到了,要开始重新配置,感觉是比较麻烦。

隐隐约约地记得看到过有人说把配置文件统一放到一个仓库里,然后到了新的环境拉下来,然后软链接过去。那么哪些配置文件适合放呢?

2679 次点击
所在节点    程序员
8 条回复
leoleoasd
2021-11-27 00:05:23 +08:00
直接用 yadm
大部分 dotfiles 都用 yadm 管理
ryougifujino
2021-11-27 00:35:18 +08:00
@leoleoasd 还不知道这个,去研究一下。
kidonng
2021-11-27 00:59:03 +08:00
如果是软链的话,通常是 GNU Stow 或者 lra/mackup 管理的。前者一般适用命令行程序,后者是针对 macOS 的,命令行程序和图形界面应用的配置通吃。
如果只是单纯想要个用 Git 管理配置文件的工具的话,推荐 twpayne/chezmoi 。
跑题了。真要说其实没有“推荐”备份的配置,所有的个人配置都建议备份,包括但不限于 ~/.config ,~/Library/Preferences (以及其他 ~/Library 下有价值的文件),以及家目录下的隐藏配置文件。换句话说,只有不想备份的,没有不能备份的。
Volekingsg
2021-11-27 09:26:40 +08:00
个人不建议 git wrapper 类工具,引入复杂度且并不能带来太多收益。
以及不喜欢需要第三方依赖的工具,然后就没啥太多可选的了,make, stow + mackup
calmzhu
2021-11-27 22:13:40 +08:00
我是用户目录整个做 git 。
不敌定时看看有什么新的。
要的加进版本,不要的 gitignore
calmzhu
2021-11-27 22:17:42 +08:00
.bash_profile
.config/git/config
.config/git/ignore
.config/git/template/hooks/pre-commit
.config/pip/pip.conf
.gitignore
.inputrc
.kube/config
.plugin/alias.sh
.plugin/bash_completion
.plugin/bookmarks.sh
.plugin/git-completion.bash
.plugin/helm-completion.bash
.plugin/kubectl-competion
.plugin/set_terminal_proxy.sh
.plugin/ssh-completion.bash
.plugin/venvwrapper.sh
.ssh/config
.tmux/plugins/tmux-always/always.tmux
.tmux/plugins/tmux-resurrect/resurrect.tmux
.tmux/plugins/tmux-resurrect/save_command_strategies/gdb.sh
.tmux/plugins/tmux-resurrect/save_command_strategies/linux_procfs.sh
.tmux/plugins/tmux-resurrect/save_command_strategies/pgrep.sh
.tmux/plugins/tmux-resurrect/save_command_strategies/ps.sh
.tmux/plugins/tmux-resurrect/scripts/check_tmux_version.sh
.tmux/plugins/tmux-resurrect/scripts/helpers.sh
.tmux/plugins/tmux-resurrect/scripts/process_restore_helpers.sh
.tmux/plugins/tmux-resurrect/scripts/restore.exp
.tmux/plugins/tmux-resurrect/scripts/restore.sh
.tmux/plugins/tmux-resurrect/scripts/save.sh
.tmux/plugins/tmux-resurrect/scripts/spinner_helpers.sh
.tmux/plugins/tmux-resurrect/scripts/tmux_spinner.sh
.tmux/plugins/tmux-resurrect/scripts/variables.sh
.tmux/plugins/tmux-resurrect/strategies/irb_default_strategy.sh
.tmux/plugins/tmux-resurrect/strategies/mosh-client_default_strategy.sh
.tmux/plugins/tmux-resurrect/strategies/nvim_session.sh
.tmux/plugins/tmux-resurrect/strategies/vim_session.sh
.tmux/plugins/tmux-resurrect/video/issue_vid.png
.tmux/plugins/tmux-resurrect/video/screencast_img.png
.tmux/plugins/tmux-resurrect/video/script.md
.tmux/themes/simple
.tmux/tmux.conf
.user.plugin/.brew_mirrors
.user.plugin/.user.bash_profile
.user.plugin/alias.sh
.vim/.netrwhist
.vim/colors/desert.vim
.vim/colors/molokai.vim
.vim/colors/solarized.vim
.vim/colors/vividchalk.vim
.vim/colors/wombat256mod.vim
.vim/templates/common/ext/html
.vim/templates/common/ext/pl
.vim/templates/common/ext/py
.vim/templates/common/ext/sh
.vim/vimrc
skiy
2021-11-28 12:01:03 +08:00
你们都存配置文件的啊?我只存脚本。拉脚本下来,再执行安装和配置。(不污染系统自带的环境)
elfsundae
2021-11-29 20:38:47 +08:00
适合自己的才是最好的,所以我选择自己写个备份还原脚本,主要利用 rsync ,和各种包管理器的 dump 命令

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/818278

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX