V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ryougifujino
V2EX  ›  程序员

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

  •  
  •   ryougifujino ·
    ryougifujino · 2021-11-27 00:02:24 +08:00 · 2665 次点击
    这是一个创建于 878 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    8 条回复    2021-11-29 20:38:47 +08:00
    leoleoasd
        1
    leoleoasd  
       2021-11-27 00:05:23 +08:00   ❤️ 3
    直接用 yadm
    大部分 dotfiles 都用 yadm 管理
    ryougifujino
        2
    ryougifujino  
    OP
       2021-11-27 00:35:18 +08:00
    @leoleoasd 还不知道这个,去研究一下。
    kidonng
        3
    kidonng  
       2021-11-27 00:59:03 +08:00 via Android   ❤️ 1
    如果是软链的话,通常是 GNU Stow 或者 lra/mackup 管理的。前者一般适用命令行程序,后者是针对 macOS 的,命令行程序和图形界面应用的配置通吃。
    如果只是单纯想要个用 Git 管理配置文件的工具的话,推荐 twpayne/chezmoi 。
    跑题了。真要说其实没有“推荐”备份的配置,所有的个人配置都建议备份,包括但不限于 ~/.config ,~/Library/Preferences (以及其他 ~/Library 下有价值的文件),以及家目录下的隐藏配置文件。换句话说,只有不想备份的,没有不能备份的。
    Volekingsg
        4
    Volekingsg  
       2021-11-27 09:26:40 +08:00   ❤️ 1
    个人不建议 git wrapper 类工具,引入复杂度且并不能带来太多收益。
    以及不喜欢需要第三方依赖的工具,然后就没啥太多可选的了,make, stow + mackup
    calmzhu
        5
    calmzhu  
       2021-11-27 22:13:40 +08:00
    我是用户目录整个做 git 。
    不敌定时看看有什么新的。
    要的加进版本,不要的 gitignore
    calmzhu
        6
    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
        7
    skiy  
       2021-11-28 12:01:03 +08:00
    你们都存配置文件的啊?我只存脚本。拉脚本下来,再执行安装和配置。(不污染系统自带的环境)
    elfsundae
        8
    elfsundae  
       2021-11-29 20:38:47 +08:00 via iPhone
    适合自己的才是最好的,所以我选择自己写个备份还原脚本,主要利用 rsync ,和各种包管理器的 dump 命令
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3366 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:57 · PVG 19:57 · LAX 04:57 · JFK 07:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.