0

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??

Bugs
  • 4,491
  • 9
  • 32
  • 41
Lamda
  • 914
  • 3
  • 13
  • 39
  • could it be the credentials ? are you on the right branch ? – sop Jun 14 '17 at 06:20
  • May be your repository code is up to date with git code. This message will come only when your repo code is same as git code. – Kondiba Jun 14 '17 at 06:20
  • @sob the changes I can see online is on the public version, so I don't think that should be an issue.. – Lamda Jun 14 '17 at 06:27
  • @Kondiba i've checked not the case... – Lamda Jun 14 '17 at 06:28
  • If you clone, you do not need to pull. You already have latest commit. Maybe you are a bit confused about branches? What did you cloned and what did you pull? If you pull SAME branch you cloned, you are up to date. – sensorario Jun 14 '17 at 13:58

3 Answers3

1

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
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Let me check with a sparse checkout (https://stackoverflow.com/a/41162452/6309) excluding the folder result: https://stackoverflow.com/a/15295915/6309 – VonC Jun 14 '17 at 06:54
  • thanks for the answer.. I would actually rather have the possibility of git pulling the solution, rather than cloning... – Lamda Jun 14 '17 at 07:27
  • @Lamda yes, my answer illustrates both approaches (pull and clone), each time with a sparse checkout which excludes the troublesome folder. – VonC Jun 14 '17 at 07:29
  • @Lamda Are you on Windows? What is your version of Git? – VonC Jun 14 '17 at 07:29
  • I on linux/unix.. git version 2.8.3 – Lamda Jun 14 '17 at 08:48
  • OK. First, upgrade to 2.13.1, and see if the issue persists. – VonC Jun 14 '17 at 08:50
  • it did not help.. – Lamda Jun 14 '17 at 10:09
  • Did you see any error message during the clone? – VonC Jun 14 '17 at 10:13
  • Only `X11 forwarding request failed on channel 0` – Lamda Jun 16 '17 at 14:08
  • @Lamda are you using an ssh url or an https one when cloning? Because I see this error message for ssh: https://unix.stackexchange.com/a/240015/7490 – VonC Jun 16 '17 at 18:43
  • I use ssh. I was able to git pull now.. weird? – Lamda Jun 23 '17 at 10:45
  • Sorry... My error was caused by something way different. 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... Doh. – Lamda Jul 28 '17 at 09:37
1

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

When you clone, you do not need to pull. You already have latest commit.

sensorario
  • 20,262
  • 30
  • 97
  • 159
  • the version I clone isn't the latest version.. which is why i git pull after.. I already have a git directory with the repo, in which i have been pulling to get recent updates, but I just noticed that an I update that I needed (bug fix) is not being pulled from the repo. – Lamda Jun 14 '17 at 16:44
0

Sorry... My error was caused by something way different. 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... Doh.

Lamda
  • 914
  • 3
  • 13
  • 39
  • Thank you. I have updated my answer with a link to what you can do (rebase your work on top of the updated original repo) in order for you to see the files from GitHub in your local repo and then push everything to your fork) – VonC Jul 28 '17 at 11:49