在 fork 别人的点文件 github 回购后应用点文件

applying dotfiles after forking someone else's dotfiles github repo

我正在尝试使用 git 管理我的点文件,并找到了一个很好的点文件存储库作为 https://mths.be/dotfiles 中的基础。 所以我将 https://mths.be/dotfiles 存储库分叉到我的 github 帐户。我正在尝试使用符号链接将点文件应用到我的主目录,但我似乎做不到。

根据 https://mths.be/dotfiles 中的自述文件,我已经完成了 "set -- -f; source bootstrap.sh" 之前的所有操作。但我被困住了,找不到解决办法。显然 bootstrap.sh 似乎也不能正常工作。

总而言之,我的问题是(作为 github 和管理点文件的新手):

  • 如何在主目录以外的其他目录中应用点文件? (我听说你可以使用符号链接来做到这一点……但具体怎么做呢?
  • https://github.com/mathiasbynens/dotfiles/blob/master/bootstrap.sh 中的第 13 行似乎有问题(if [ "$1" == "--force" -o "$1" == "-f" ]; then)。当我尝试查找 bootstrap.sh 时,它说 = 未找到。怎么了?
  • bootstrap.sh 的作用到底是什么?

    非常感谢。

    下面是bootstrap.sh代码

    #!/usr/bin/env bash
    
    cd "$(dirname "${BASH_SOURCE}")";
    
    git pull origin master;
    
    function doIt() {
        rsync --exclude ".git/" --exclude ".DS_Store" --exclude ".osx" \
        --exclude "bootstrap.sh" --exclude "README.md" --exclude "LICENSE-MIT.txt" -avh --no-perms . ~;
        source ~/.bash_profile;
    }
    
    if [ "" == "--force" -o "" == "-f" ]; then
        doIt;
    else
        read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
        echo "";
        if [[ $REPLY =~ ^[Yy]$ ]]; then
            doIt;
        fi;
    fi;
    unset doIt;
    
  • 你似乎在使用 zsh 但你提到的 dotfiles repo 没有使用 zsh (你可以通过缺少 .zshrc 文件看到这一点)


    要使用特定配置,您 link 将这些文件(以及这些配置使用的文件夹)放入您的主文件夹中。例如.vimrc

    $ cd ~
    $ ln -s /path/to/dotfiles/.vimrc .vimrc
    $ ln -s /path/to/dotfiles/.vim .vim
    

    第一个命令会将目录更改为您的主文件夹。

    第二个命令将从点文件存储库 .vimrc 创建一个符号 link 到您的主文件夹

    第三个命令将 link .vim 文件夹(在 .vimrc 中使用)放入您的主文件夹


    先回答你问题的第三部分(因为前两个还没有弄清楚)我会引用README.md

    The bootstrapper script will pull in the latest version and copy the files to your home folder.

    我会在其他答案变得更清楚时添加它们