Unable to work effectively with Git locally

前端 未结 2 1398
我在风中等你
我在风中等你 2021-01-25 02:32

Please, see Greg\'s answer.

I do not understand Daniel\'s statement at the thread completely:

Why are you manually copying files around

2条回答
  •  无人及你
    2021-01-25 03:08

    1) I back up my .dotfiles as follows:

    a) Create a directory ~/dotfiles

    b) link dotfile into ~/dotfiles/ e.g.

    ln ~/.bashrc ~/dotfiles/.bashrc  # NB Must be hard links
    

    c)

    cd ~/dotfiles
    git init
    git add .  
    git commit -m "Initial commit of dotfiles"
    

    2) You can also refer to a Git repo not in the current directory tree by exporting the environment string GIT_DIR .e.g (assuming at repo at ~/myrepos/repo1)

    a)

     export GIT_DIR=~/myrepos/repo1/.git
    

    b)

     git add .profile  
     git commit -m "added .profile"
    

    Does that help at all?

提交回复
热议问题