在 Git 中,您可以将给定目录克隆到给定目录:
git clone ssh://gitolite@dev.bipper.com:3687/com/bipper/kids/portal <dir>
当我运行我们的构建脚本之一时,“cd”命令会导致一些复杂的问题我想使用 git pull 这样的东西:
git pull <dir-to-the-git-folder>
因此在执行 pull (或获取/merge )时不必在 git 文件夹中,是否有可能以某种方式实现(我上面的示例不起作用)
最佳答案
我认为你应该看看 git-dir
也许还有work-tree
选项。您还可以使用 GIT_DIR
/GIT_WORK_TREE
如果您愿意,可以使用变量。
查看手册:
--git-dir=<path>
Set the path to the repository. This can also be controlled by setting the GIT_DIR environment variable. It can be an absolute path or relative path to current working directory.
-work-tree=<path>
Set the path to the working tree. It can be an absolute path or a path relative to the current working directory. This can also be controlled by setting the GIT_WORK_TREE environment variable and the core.worktree configuration variable (see core.worktree in git-config(1) for a more detailed discussion).
关于Git pull 入 "remote"目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12473707/