gpt4 book ai didi

git - 我可以将我的本地 Github 存储库与 WAMP localhost 文件夹结合起来吗?

转载 作者:太空狗 更新时间:2023-10-29 13:38:21 25 4
gpt4 key购买 nike

我的本​​地 GitHub 存储库有 C:\Users\my\Documents\GitHubC:\wamp\www 是我在本地处理项目的地方Wamp 服务器。

什么是适合它们的设置?我应该告诉 Git 使用“www”作为我的本地存储库吗?这会将 localhost 与 Github 结合起来吗??

最佳答案

您可以简单地使用 git 的 --work-tree 或 --git-dir 参数来:

  • 在 Github 文件夹中,但提到工作树是 www

    cd C:\Users\my\Documents\GitHub
    git --work-tree=C:\wamp\www status
  • 或者在 www 文件夹中并提到 git 存储库在 Github 中

    cd C:\wamp\www status
    git --git-dir=C:\Users\my\Documents\GitHub\.git

另一种方法是在两者中都有一个 git 仓库,并从 www pull Github

    cd C:\wamp\www status
git add remote origin C:\Users\my\Documents\GitHub
git pull origin master

关于git - 我可以将我的本地 Github 存储库与 WAMP localhost 文件夹结合起来吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22953060/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com