我可以将我的本地 Github 存储库与 WAMP localhost 文件夹结合起来吗? [英] Can I combine my local Github repository with WAMP localhost folder?
问题描述
我的本地 GitHub 存储库有 C:UsersmyDocumentsGitHub,C:wampwww 是我在本地处理项目的地方Wampserver.
I have C:UsersmyDocumentsGitHub for my local GitHub repository, and C:wampwww is where I work on projects locally with Wampserver.
什么是与他们一起工作的适当设置?我应该告诉 Git 使用www"作为我的本地存储库吗?会不会把 localhost 和 Github 结合起来??
What is the appropriate setup to work with them both? Should I tell Git to use 'www' as my local repository? Will that combine localhost with Github??
推荐答案
您可以简单地使用 git 的 --work-tree 或 --git-dir 参数来:
You could simply use the --work-tree or --git-dir argument of git in order to:
在 Github 文件夹中,但要提到工作树是 www
be in the Github folder, but mention that the working tree is www
cd C:UsersmyDocumentsGitHub
git --work-tree=C:wampwww status
或在 www 文件夹中并提及 git repo 在 Github 中
or be in the www folder and mention that the git repo is in the Github one
cd C:wampwww status
git --git-dir=C:UsersmyDocumentsGitHub.git
另一种方法是在两者中都有一个 git repo,并从 www
中提取 Github
.
The other approach is to have a git repo in both, and pulling Github
from www
.
cd C:wampwww status
git add remote origin C:UsersmyDocumentsGitHub
git pull origin master
这篇关于我可以将我的本地 Github 存储库与 WAMP localhost 文件夹结合起来吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!