Search code examples
gitdartdart-pub

pub get throws a git fetch error when trying to get dependencies


This is the error received:

C:\code\workspace\test_app_polymer>pub get
Resolving dependencies...
Git error. Command: git fetch
fatal: Not a git repository (or any of the parent directories): .git

It seems that whatever it is looking at, at that point is not a git repo.

The command I used to clone my repo was, with a modified domain name :

git clone -v [email protected]:ng-incubator/test_app_polymer.git .

So to me cloning this and then being able to do pub get should work. Now, the next step would be to look at the dependencies which are attempted.

dependencies:
  browser: any
  url: any
  uuid: any
  tw_portal:
    git:
      url: [email protected]:portal_ng/portal_dart.git
      ref: master
  tw_ui_polymer:
    git:
      url: [email protected]:portal_ng/ui_polymer
      ref: master

If you can take a look, it shows ui_polymer is not defined as a .git, so I ran it an additional time, with: url: [email protected]:ng_portal/ui_polymer.git to see if that works. It took longer to run before failing.... So that means at least there was more computation.

Am I following these steps correctly for debugging? I was informed that the Server was updated recently, so there is a chance it is entirely a server error and not even client side. Does anyone have any speculation as to what I may do to continue to debug?

Thanks.


Solution

  • There were 2 issues i needed to address. the concept of pub get. When i was doing it, it was not giving me a password spot to enter in things like IntelliJ. So because of this, I removed the password. Dont worry it isnt my normal id_rsa, but instead just a little dev one.

    Anyways, now that it wont pass the password into Git, that part is resolved, but there is one issue. The Cache is saved with the failed password get, and because of that will continue to fail.

    Clear the Cache is a key part. I noticed this cache was in, for my account:

    C:\Users\fallenreaper\AppData\Roaming\Pub\Cache\git\cache\
    

    As you can see, this is in fact a windows machine. I was not sure which of the structures were jacked up, so i just deleted them all.

    Now, back to cmd (or intelliJ). You cleared the cache and you have no password. Now you can Get Dependencies or run pub get in the dev folder (I do just inside of the root folder).

    It will pull, update, and do all the compilings you need and you are ready to go. The final step is to Build and then Open With... Dartium.

    Edit The password i am talking about is in relation to the id-rsa key i was leveraging when cloning this project down