git clone是不是克隆某个版本库的最新版本? [英] git clone is not cloning recent version of a certain repository?

查看:2829
本文介绍了git clone是不是克隆某个版本库的最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直注意到,我无法克隆名为存储库中的最新版本>卡尔迪



我如何知道?我可以看到我在计算机上克隆的本地文件与GitHub上的文件不同。

我试过克隆,并从当前的git目录中获取git pull,这表明这是最新的,这没有任何意义。



什么可能会阻止我的机器获取最新版本的资源库?

解决方案

  git status 
git log - -oneline --graph --decorate -10

这会给你一个关于你的分支的想法正如OP所述:

< blockquote>

我最初将repo分叉,并试图更新本地repo。

但是由于没有发生任何变化, / strong>。

在这种情况下,通常请参阅 Git working fork with updates :您将在 upstream / master 之上重新绑定您的本地分支。






我刚刚克隆了 - > kaldi-asr / kaldi :

  D:\ git> git clone https://github.com/kaldi-asr/kaldi 
克隆到'kaldi'...
remote:计数对象:83872,完成。
remote:压缩对象:100%(35/35),完成。
remote:合计83872(delta 8),重用19(delta 5),包重用83832
接收对象:100%(83872/83872),105.24 MiB | 512.00 KiB / s,完成。
解析三角洲:100%(65063/65063),完成。
错误:无法创建文件egs/babel/s5d/results/kws_results.104-pashto.flp.marcc2.conf.jtrmal1@jhu.edu.2016-03-31T11:34:24-04:00:无效参数
错误:无法创建文件egs/babel/s5d/results/kws_results.305-guarani.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:04:03-04: 00:无效参数
错误:无法创建文件egs/babel/s5d/results/kws_results.306-igbo.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:12:45- 04:00:参数无效
错误:无法创建文件egs/babel/s5d/results/kws_results.307-amharic.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:21: 34-04:00:无效的参数
...



  D:\ git \kaldi> git st 
分支主
您的分支是最新的'起源/主'。
要提交的更改:
(使用git reset HEAD< file> ...停用)

已删除:.gitattributes
已删除:.gitignore
已删除:.travis.yml
已删除:COPYING
已删除:INSTALL



git reset --hard 无法改善情况:

  D:\ git \kaldi> git reset --hard 
错误:无法创建文件egs/babel/s5d/results/kws_results.104-pashto.flp.marcc2.conf.jtrmal1@jhu。 edu.2016-03-31T11:34:24-04:00:无效参数
错误:无法创建文件egs / babel / s5d / results / kws_results.305-guarani.flp.marcc.conf.jtrmal1 @ jhu.edu.2016-03-31T12:04:03-04:00:无效参数
错误:无法创建文件egs / babel / s5d / results / kws_results.306-igbo.flp.marcc.conf。 jtrmal1@jhu.edu.2016-03-31T12:12:45-04:00:无效参数
错误:无法创建文件egs / babel / s5d / results / kws_results.307-amharic.flp.marcc。 conf.jtr mal1@jhu.edu.2016-03-31T12:21:34-04:00:参数无效
...
检出文件:100%(5243/5243),完成。
致命:无法将索引文件重置为修订版本HEAD。

有些文件仍然无法结帐,因为它们包含与Windows文件系统不兼容的字符
也就是''一个。 / p>

如果我添加:

  D:\ git \kaldi> ; git config core.sparsecheckout true 
D:\ git\kaldi> echo!results /> .git / info / sparse-checkout
D:\git\kaldi> echo / *>> .git / info / sparse-checkout

然后一个 git reset --hard



我测试了一个稀疏的克隆,它也可以工作:

  D:\ git> git init kaldi2 
在D:/git/kaldi2/.git/

中初始化了空的Git仓库D:\\ \\ git> cd kaldi2

D:\ git \kaldi2> git remote add origin https://github.com/kaldi-asr/kaldi
D:\ git \ kaldi2> git config core.sparsecheckout true
D:\ git \kaldi2> echo!results /> .git / info / sparse-checkout
D:\ git \kaldi2> echo / *>> .git / info / sparse-checkout

D:\ git \kaldi2> git pull origin master


I have been for while noticing that i am unable to clone the recent version from a repository named kaldi.

How I know? I can see that the local files I've cloned on my computer aren't the same as the on GitHub.

i've tried cloning, and git pull from a current git directory, which states that is up to date which makes no sense.

what could prevent my machine in getting the most recent version of the repository??

解决方案

The first thing to check after a fresh clone is:

git status
git log --oneline --graph --decorate -10

That will give you an idea of the branch on you are one, and the commit you are seeing (and its 9 parent commits)

As mentioned by the OP:

I had initially forked the repo, and was trying to update my local repo.
But since no change had occurred in that one, nothing could be pulled.

In that case, typically, see "Git working fork with updates": you would rebase your local branch on top of upstream/master.


I just cloned kaldi-asr/kaldi on my Windows 10 laptop, using Git 2.13, and I do see some errors:

D:\git>git clone https://github.com/kaldi-asr/kaldi
Cloning into 'kaldi'...
remote: Counting objects: 83872, done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 83872 (delta 8), reused 19 (delta 5), pack-reused 83832
Receiving objects: 100% (83872/83872), 105.24 MiB | 512.00 KiB/s, done.
Resolving deltas: 100% (65063/65063), done.
error: unable to create file egs/babel/s5d/results/kws_results.104-pashto.flp.marcc2.conf.jtrmal1@jhu.edu.2016-03-31T11:34:24-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.305-guarani.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:04:03-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.306-igbo.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:12:45-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.307-amharic.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:21:34-04:00: Invalid argument
...

And git status shows everything deleted:

D:\git\kaldi>git st
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        deleted:    .gitattributes
        deleted:    .gitignore
        deleted:    .travis.yml
        deleted:    COPYING
        deleted:    INSTALL

A git reset --hard fails to improve the situation:

D:\git\kaldi>git reset --hard
error: unable to create file egs/babel/s5d/results/kws_results.104-pashto.flp.marcc2.conf.jtrmal1@jhu.edu.2016-03-31T11:34:24-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.305-guarani.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:04:03-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.306-igbo.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:12:45-04:00: Invalid argument
error: unable to create file egs/babel/s5d/results/kws_results.307-amharic.flp.marcc.conf.jtrmal1@jhu.edu.2016-03-31T12:21:34-04:00: Invalid argument
...
Checking out files: 100% (5243/5243), done.
fatal: Could not reset index file to revision 'HEAD'.

Some files remains impossible to checkout because they include characters which are not compatible with the Windows filesystem.
Namely the ':' one.

If I add:

D:\git\kaldi>git config core.sparsecheckout true
D:\git\kaldi>echo !results/ > .git/info/sparse-checkout
D:\git\kaldi>echo /* >> .git/info/sparse-checkout

Then a git reset --hard does work!

I just tested a sparse clone, and it works too:

D:\git>git init kaldi2
Initialized empty Git repository in D:/git/kaldi2/.git/

D:\git>cd kaldi2

D:\git\kaldi2>git remote add origin https://github.com/kaldi-asr/kaldi
D:\git\kaldi2>git config core.sparsecheckout true
D:\git\kaldi2>echo !results/ > .git/info/sparse-checkout
D:\git\kaldi2>echo /* >> .git/info/sparse-checkout

D:\git\kaldi2>git pull origin master

这篇关于git clone是不是克隆某个版本库的最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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