Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone git-lfs filter-process: git-lfs: command not found

Tags:

git-lfs

I'm trying to clone a project from git by this:

git clone link

And got this message

remote: Enumerating objects: 24533, done.
remote: Counting objects: 100% (24533/24533), done.
remote: Compressing objects: 100% (5045/5045), done.
remote: Total 24533 (delta 15448), reused 24389 (delta 15306), pack-reused 0
Receiving objects: 100% (24533/24533), 75.12 MiB | 10.96 MiB/s, done.
Resolving deltas: 100% (15448/15448), done.
git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

I've been searching around and tried:

git config --system core.longpaths true

but it doensn't work and my disk is plenty free

like image 957
bao le Avatar asked May 05 '21 04:05

bao le


People also ask

What is git LFS filter process?

The filter process is the part where LFS sneakily hides and retrieves the real files that Git never sees (Git sees only "pointer files" that tell the filter process where the real files are). So if the filter process is stuck, you can't get your real files.

How do I initialize git LFS?

To create a new Git LFS aware repository, you'll need to run git lfs install after you create the repository: # initialize Git $ mkdir Atlasteroids $ cd Atlasteroids $ git init Initialized empty Git repository in /Users/tpettersen/Atlasteroids/. git/ # initialize Git LFS $ git lfs install Updated pre-push hook.

Is there a 'LFS' command in Git?

I received git: 'lfs' is not a git command. See 'git --help'. I had to apt install git-lfs. feedback: for me the 'Setup git repository with git-lfs' part is visually to complex. the part 'Clone repository' is nice any simple.

How do I clone a Git LFS repository?

Once Git LFS is installed, you can clone a Git LFS repository as normal using git clone. At the end of the cloning process Git will check out the default branch (usually master ), and any Git LFS files needed to complete the checkout process will be automatically downloaded for you.

How to ignore all LFS downloads in Git?

You can tell Git LFS to ignore all LFS downloads like this: $ git lfs clone [email protected] -X "*.*" The git lfs clone command has include/exclude flags to control what's downloaded. The fetch and pull commands accept the same flags, and include info on making this configuration default if you want.

How do I delete a specific file in Git LFS?

Deleting local Git LFS files You can delete files from your local Git LFS cache with the git lfs prune command: $ git lfs prune ✔ 4 local objects, 33 retained Pruning 4 files, (2.1 MB) ✔ Deleted 4 files This will delete any local Git LFS files that are considered old.


Video Answer


5 Answers

If you are on Mac, run:

brew install git-lfs
git lfs install
like image 74
Lukasz Czerwinski Avatar answered Oct 19 '22 17:10

Lukasz Czerwinski


You might try to push a repository that contains files of huge size. So, We have to install git-lfs in that case.

For Windows:

  • Download git-lfs from the official site (download) and install it in your machine.

  • Then set up Git LFS for your user account by running the following command in your terminal:

    git lfs install
    

For Mac:

  • Run the following commands in your terminal.

    brew install git-lfs
    git lfs install
    

For Ubuntu:

  • Run the following commands in your terminal.

    sudo apt install git-lfs
    git lfs install
    
like image 45
Codemaker Avatar answered Oct 19 '22 19:10

Codemaker


TL;DR

Perhaps git didn't get linked to git-lfs on the machine. Try linking it:

ln -s "$(which git-lfs)" "$(git --exec-path)/git-lfs"

Explanation

Although it said something missing, git-lfs could actually be installed on the machine but git just didn't find it in its search path. Therefore, we create a symbolic file in its search path:

$(git --exec-path)/git-lfs

linking to the typically installed one on the machine:

which git-lfs
like image 17
Ting Yi Shih Avatar answered Oct 19 '22 18:10

Ting Yi Shih


Encountered the same problem, the answer by Teodoriko did not work for me got the result:

git: 'lfs' is not a git command. See 'git --help'.

What worked for me was to install the dependency with:

sudo apt install git-lfs

My git version 2.27.0

like image 5
James Dube Avatar answered Oct 19 '22 17:10

James Dube


This is a simple one. Check the documentation to the installation types based on your OS. For linux, just follow these commands:

  1. Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running:

    git lfs install
    

You only need to run this once per user account.

  1. In each Git repository where you want to use Git LFS, select the file types you'd like Git LFS to manage (or directly edit your .gitattributes). You can configure additional file extensions at anytime.

    git lfs track "*.psd"
    

Now make sure .gitattributes is tracked:

  git add .gitattributes

Note that defining the file types Git LFS should track will not, by itself, convert any pre-existing files to Git LFS, such as files on other branches or in your prior commit history. To do that, use the git lfs migrate[1] command, which has a range of options designed to suit various potential use cases.

  1. There is no step three. Just commit and push to GitHub as you normally would; for instance, if your current branch is named main:

    git add file.psd
    
    git commit -m "Add design file"
    
    git push origin main
    

References: https://git-lfs.github.com/

like image 1
Teodorico Maziviala Avatar answered Oct 19 '22 17:10

Teodorico Maziviala