问题描述
我的本地GitHub存储库中有 \Users\my\Documents\GitHub ,而 C:\wamp\www 是其中的地方我使用Wampserver在本地开展项目工作。
与他们合作的适当设置是什么?我应该告诉Git使用'www'作为我的本地存储库吗?这将结合本地主机和Github吗?
您可以简单地使用--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
I have C:\Users\my\Documents\GitHub for my local GitHub repository, and C:\wamp\www is where I work on projects locally with Wampserver.
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??
You could simply use the --work-tree or --git-dir argument of git in order to:
be in the Github folder, but mention that the working tree is www
cd C:\Users\my\Documents\GitHub git --work-tree=C:\wamp\www status
or be in the www folder and mention that the git repo is in the Github one
cd C:\wamp\www status git --git-dir=C:\Users\my\Documents\GitHub\.git
The other approach is to have a git repo in both, and pulling Github from www.
cd C:\wamp\www status git add remote origin C:\Users\my\Documents\GitHub git pull origin master
这篇关于我可以将本地Github存储库与WAMP本地主机文件夹结合起来吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!