gpt4 book ai didi

windows - 如何 pull 和 check out 远程 Git 存储库

转载 作者:可可西里 更新时间:2023-11-01 12:09:12 24 4
gpt4 key购买 nike

好的,对于 Windows 7 上的 msysgit,完全是菜鸟问题,但我有一个远程存储库(在 unfuddle 上),在一台 PC 上创建,现在我想将它 pull 到另一台 PC 上。我尝试使用 Git Gui 进行“获取”,但该文件夹仍然只有一个 .git 子文件夹。把它 pull 下来花了一段时间,所以我假设 repo 协议(protocol)中有一些东西,但我如何将它 checkout 到工作副本。我尝试过的任何东西似乎都不起作用。

解决方案:这不是直接在他的回答中,但下面的 VonC 向我指出了 Git 的 unfuddle 帮助文档,它与 Git 手册页一样简洁。以下单个命令为我提供了所需的工作副本和本地存储库:

$ git clone git@subdomain.unfuddle.com:subdomain/abbreviation.git

最佳答案

Git documentation on Unfuddle 之后,您是否将您的 unfunddle repo 声明为远程?

$ cd /path/to/repository
$ git remote add unfuddle git@subdomain.unfuddle.com:subdomain/abbreviation.git

也试试 gitk --all:如果获取成功,你应该远程跟踪分支(比如 unfuddle/master)。然后您可以将它 merge 到您的 master 分支,以便最终在您的(仍然是空的)工作树中看到文件。
您也可以执行 git pull 将这两个步骤组合在一起 (fetch+merge)。看这个blog post用于说明。


实际上,OP ProfK报告克隆问题:

I did already have the unfuddle remote added

git clone git@subdomain.unfuddle.com:subdomain/abbreviation.git

更适合获取已添加正确 Remote 的本地存储库。

关于windows - 如何 pull 和 check out 远程 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3240389/

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