Git克隆-再次不检出 [英] Git clone --no-checkout again

查看:199
本文介绍了Git克隆-再次不检出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想浪费机器上的空间,我只想查看存储库的历史记录(针对每个分支).这就是为什么,我做了:

I don't want to waste space on my machine and I only want to see the history of repository (for each branch). That's why, I did a:

    git clone --no-checkout

完成此操作后,有人推了些东西.我必须做一些事情才能使历史记录更新,但是我不知道该怎么办.当然,我可以使用git checkout& git pull,但是我不需要文件,我只需要更新.git文件夹.我尝试使用git fetch,但似乎历史记录未更新.

After I did this, somebody pushed something. I have to do something to be again with the history updated, but I don't know what. Of course, I can use git checkout & git pull, but I don't need the files, I need only the .git folder to be updated. I tried with git fetch, but it seems the history is not updated.

推荐答案

git clone

更新:

克隆完成后,请确保配置中的remote.origin部分(请参见回购中的config文件)包含带有适当字符的fetch密钥.该部分应如下所示:

after the cloning is completed make sure that the section remote.origin in the configuration (see config file in the repo) contains fetch key with an appropriate. The section should look like this:

[remote "origin"]
    url = <upstream repo remote address>
    fetch = +refs/heads/*:refs/remotes/origin/*

然后,您可以通过在存储库中发出git fetch来不时更新存储库.

Then you may update the repo from time to time by issuing git fetch inside the repo.

这篇关于Git克隆-再次不检出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆