我正在学习git,我使用它的测试用例是保存我的linux配置文件设置(.bashrc .profile .tmux.conf等)。
在我的主计算机上,回购文件是在主文件夹中创建的: base=/ home /bvector/ files=/home/bvector/..profile,等等。
但是,当我在machine2上克隆回购时,它会转到/home/bvector/home (因为回购名为home) base=/home/bvector/home/ file=/home/bvector/home/..profile,等等。
是否有一种方法,使克隆回购是基于我的主文件夹与所有文件在正确的地方,默认情况下?我所读到的所有内容都表明,您不能将回购复制到非空目录,这将使在多台机器上进行回购变得更加麻烦,并且能够无缝地提交更改。
发布于 2012-04-24 06:15:47
Github刚刚启动了一组新的页面,描述了如何在这种情况下使用Github。
http://dotfiles.github.com/
发布于 2012-04-24 00:45:58
容易(不雅?)要做的事情是:
git clone --bare whatever ~/.git--bare选项告诉它基本上签出一个普通.git目录的内容(这样它就不会检出一个工作副本),然后放到~/.git目录中。您可以使用git checkout <file>获取单个文件,或者使用git reset --hard替换git存储库中的所有现有文件。
发布于 2012-04-24 04:59:24
cd ~
git init
git remote add origin ssh://host/repo.git
git pull origin master这在这种情况下是可行的。来自https://stackoverflow.com/questions/9443927/git-clone-into-home-directory
https://serverfault.com/questions/382384
复制相似问题