git - 是否支持在 .git 文件中指定工作树?
问题描述
我在一个.git
文件中有这个:
gitdir: path\to\git-dir
我还想添加工作树目录,阿拉
worktree: path\to\work-tree
git 支持吗?
解决方案
我找到了解决我的问题的方法 [供将来参考:https ://rakhesh.com/coding/how-to-move-separate-the-git-folder-out-of-your-working-tree ]。
可以在 git 文件夹配置文件中指定工作树 [不是在 .git 文件中,而是];通过添加worktree
一行。就这么简单:)
示例git-dir/config
文件:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
>> worktree = <path/to/work-tree>
推荐阅读
- python - PySimpleGui - 获取按钮文本
- r - 如果满足条件(相同的 ID),则循环计算列中包含字符串的行数
- c++ - VS Code 中 if 语句末尾的断点
- java - Spring Cloud Stream - 如果条件满足,如何在 SpecificRecord 中读取,否则如何在 GenericRecord 中读取
- python - Django用户模型AttributeError:'str'对象没有属性'objects'
- kotlin - 控制台输出等待 coroutineScope {} 主体完成
- r - 在R中找到线方程的值
- javascript - 在 ssh2-sftp-client 中使用 ssh 指纹
- javascript - 如何将分页数字转换为阿拉伯数字?
- flutter - 如何在颤动中缓存视频?