Skip to content

Instantly share code, notes, and snippets.

@FeodorFitsner
Created September 14, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FeodorFitsner/536a24c11e509c95aa7b0ba7e4b19408 to your computer and use it in GitHub Desktop.
Save FeodorFitsner/536a24c11e509c95aa7b0ba7e4b19408 to your computer and use it in GitHub Desktop.
Cloning repo with git LFS
if(-not $env:appveyor_pull_request_number) {
git clone --depth=1 -q -c filter.lfs.smudge= -c filter.lfs.required=false --branch=$env:appveyor_repo_branch git@github.com:$env:appveyor_repo_name.git $env:appveyor_build_folder
git checkout -qf $env:appveyor_repo_commit
git lfs pull
} else {
git clone --depth=1 -q -c filter.lfs.smudge= -c filter.lfs.required=false git@github.com:$env:appveyor_repo_name.git $env:appveyor_build_folder
git fetch -q origin +refs/pull/$env:appveyor_pull_request_number/merge:
git checkout -qf FETCH_HEAD
git lfs pull
}
@pablomayobre
Copy link

I tried using this as a clone script but it failed with:

git : Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
At line:2 char:7
+       git clone --depth=1 -q -c filter.lfs.smudge= -c filter.lfs.requ ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Warning: Perman...of known hosts.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git : fatal: Not a git repository (or any of the parent directories): .git
At line:3 char:7
+       git checkout -qf $env:appveyor_repo_commit
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (fatal: Not a gi...ectories): .git:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Not in a git repository.
Command executed with exception: fatal: Not a git repository (or any of the parent directories): .git

Any idea why?

@IlyaFinkelshteyn
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment