【问题标题】:Is it possible to switch git repository branch from different folder?是否可以从不同的文件夹切换 git 存储库分支?
【发布时间】:2020-12-11 14:05:34
【问题描述】:

有没有办法从不同的目录切换某个git仓库的分支?

git pull

所以要从不同的目录中提取存储库,我有这样的 pull 版本

git -C c:\MyDirectory\MyRepository pull

git switch 也有类似的版本吗?

【问题讨论】:

  • 请注意,全局 Git 选项(例如 git -C <dir>)通常适用于 所有 Git 命令。 (这就是它们出现在特定命令之前的原因。)

标签: git git-pull


【解决方案1】:

是的,当然。你使用全局选项 -C 就像使用 git-pull 一样。

git -C c:\MyDirectory\MyRepository switch branch-name

【讨论】:

    猜你喜欢
    • 2013-03-03
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多