简体   繁体   中英

Is "git lfs install" included in "git lfs migrate"?

Git lfs documentation says:

Setup Git LFS on your system. You only have to do this once per
    repository per machine:

        git lfs install

Now, since how I don't know the extent of what git lfs install does, how could I check git lfs migrate has called git lfs install (which is not said in git lfs migrate doc: https://manpages.debian.org/unstable/git-lfs/git-lfs-migrate.1.en.html )?

git lfs migrate does not call git lfs install . You need to run git lfs install once per user and machine pair unless you have set up the filters appropriately by hand.

The command installs the filter commands which invoke Git LFS into the user's ~/.gitconfig file and the hooks in the present repository. Those hooks are also installed when certain Git LFS commands are invoked in a repository for the first time, but that will only happen if git lfs install has been run or the filters have been appropriately configured.

Besides installing the hooks, the git lfs install command runs the following:

git config --global filter.lfs.process "git-lfs filter-process"
git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.clean "git-lfs clean -- %f"

Running those commands, or making the equivalent edits, is sufficient to get Git LFS working without running git lfs install .

If you are using Git LFS from Debian, the filter commands may have already been set up for you, and you can check that by inspecting /etc/gitconfig . If so, you need not run them yourself, although you may want to anyway in case you end up using a non-Debian system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM