git lfs tips

The git lfs may seems like a magic for me. We try to take some notes here.

clone repo then download large file

https://gist.github.com/nepsilon/7c44e8fc597eed97e71174d6d67a5617

We generate a file here to track things. .gitattributes try to use git related command to track and untrack the file, do not update associated file manually.

push large file in local repo to remote

Fork repo with lfs but do not want to push it to forked remote repo

Some issue is remote: Gitlab: LFS Objects are missing.

One example is that when we forked a remote project and try to do some operations, then we push it. But we did not push the data of the git lfs.

One solution is that we delete the current file regarding the lfs (remove the current hook for lfs in your forked repo locally), and then set the the remote branch and do not open the lfs option.

Refources

https://gist.github.com/nepsilon/7c44e8fc597eed97e71174d6d67a5617

推荐文章