gpt4 book ai didi

git - 在自定义位置设置 .git 文件夹

转载 作者:行者123 更新时间:2023-12-03 23:08:49 25 4
gpt4 key购买 nike

这是我当前的目录结构:

  • mygit
  • code
    • .git
    • morecode
      • mycode

  • 代码文件夹由git监控,git的文件在通常的code/.git
  • 我只处理这段代码的一部分,即 mycode

  • 我想使用 git 来管理我的代码,但我不希望将其文件放在预期的 code/morecode/mycode/.git 中,而是放在代码文件夹之外,例如在我的 git 。

    任何想法如何做到这一点?

    最佳答案

    此外,您可以简单地使 .git 成为常规文件并在其中放置路径,而不是使用符号链接(symbolic link):

    $ echo gitdir:/path/to/gitdir > .git

    关于git - 在自定义位置设置 .git 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5337025/

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