【发布时间】:2014-05-22 02:16:54
【问题描述】:
我的本地 GitHub 存储库有 C:\Users\my\Documents\GitHub,C:\wamp\www 是我在本地处理项目的地方Wampserver。
什么是与他们一起工作的适当设置?我应该告诉 Git 使用“www”作为我的本地存储库吗?会不会把 localhost 和 Github 结合起来??
【问题讨论】:
标签: git version-control github localhost
我的本地 GitHub 存储库有 C:\Users\my\Documents\GitHub,C:\wamp\www 是我在本地处理项目的地方Wampserver。
什么是与他们一起工作的适当设置?我应该告诉 Git 使用“www”作为我的本地存储库吗?会不会把 localhost 和 Github 结合起来??
【问题讨论】:
标签: git version-control github localhost
您可以简单地使用 git 的 --work-tree 或 --git-dir 参数来:
在 Github 文件夹中,但要提到工作树是 www
cd C:\Users\my\Documents\GitHub
git --work-tree=C:\wamp\www status
或在 www 文件夹中并提及 git repo 在 Github 中
cd C:\wamp\www status
git --git-dir=C:\Users\my\Documents\GitHub\.git
另一种方法是在两者中都有一个 git repo,并从 www 中提取 Github。
cd C:\wamp\www status
git add remote origin C:\Users\my\Documents\GitHub
git pull origin master
【讨论】:
使用 phpstorm 完成以上所有操作。有一个很好的用户界面
【讨论】: