GIT-LFS-MIGRATE(1) GIT-LFS-MIGRATE(1) (NAME) git-lfs-migrate - Git LFS (SYNOPSIS) git lfs migrate [options] [--] [branch ...] (DESCRIPTION) Git Git LFS Git . import Git ( blob) Git LFS export info . git lfs migrate (checked-out) ( ) . . Git LFS git lfs migrate . import export <<>> Git SHA . ( << >> import << (IMPORT WITHOUT REWRITING HISTORY)>> .) import export stash info . Git force-push . Git . --include-ref . ^ --exclude-ref . --everything . << (INCLUDE AND EXCLUDE REFERENCES)>> . info import info (import) (pathspec) --fixup . ( pathspec export .) --include --exclude ( -I -X) << (INCLUDE AND EXCLUDE)>> . Git LFS .gitattributes git lfs migrate .gitattributes . .gitattributes / ( ) . (symbolic link) . import ( <> ) Git ( --include) Git LFS .gitattributes . git lfs track Git . --fixup import .gitattributes Git Git LFS . export ( <> ) import Git LFS --include ( ) . .gitattributes export << >> git lfs untrack . --remote export Git LFS LFS origin . info ( <> ) ( ) . info --everything . Git LFS . --pointers=ignore --pointers=no-follow . ( Git LFS info Git LFS ). --everything ( ) . import info --include --exclude . --everything --everything . . refs/heads/foo --everything refs/remotes/origin/foo git push origin foo . --everything --all git push . --skip-fetch git lfs migrate git remote Git . (MODES) info . <> . import Git Git LFS. <> << (IMPORT WITHOUT REWRITING HISTORY)>> . export Git LFS Git. <> . (OPTIONS) -I , --include= << (INCLUDE AND EXCLUDE)>> . -X , --exclude= << (INCLUDE AND EXCLUDE)>> . --include-ref= << (INCLUDE AND EXCLUDE REFERENCES)>> . --exclude-ref= << (INCLUDE AND EXCLUDE REFERENCES)>> . --skip-fetch <<>> . --include-ref --exclude-ref . --everything << (INCLUDE AND EXCLUDE REFERENCES)>> . : Git << (packed form)>> ( git-pack-refs(1) ). NTFS APFS macOS git-lfs-migrate(1) / . --yes . () . . [branch ...] . git-lfs-migrate(1) . ^ ^ . --include-ref --exclude-ref . INFO info Git . migrate : --above= . size "1b" "20 MB" "3 TiB" . --above . --top= n . . Git LFS n "LFS Objects" --pointers . --unit= . : o b kib mib gib tib pib - IEC o b kb mb gb tb pb - SI --unit . --pointers=[follow|no-follow|ignore] Git LFS . follow "LFS Objects" Git LFS . ignore no-follow info Git LFS . --fixup --include --exclude .gitattributes . () .gitattributes Git LFS . info .gitattributes . --include --exclude --pointers ignore --fixup --pointers=ignore . ( --above ) . : *.gif 93 MB 9480/10504 files(s) 90% *.png 14 MB 1732/1877 files(s) 92% --top . IMPORT import Git Git LFS . migrate : --verbose oid STDOUT . --above= . size "1b" "20 MB" "3 TiB" . --include --exclude --fixup . --object-map= path . CSV : OLD-SHA,NEW-SHA --no-rewrite Git LFS Git . migrate import migrate . << (IMPORT WITHOUT REWRITING HISTORY)>> . --fixup --include --exclude .gitattributes . () .gitattributes Git LFS . --include --exclude . --no-rewrite --include --exclude ( -I -X) .gitattributes . --no-rewrite gitattributes . (IMPORT WITHOUT REWRITING HISTORY) import --no-rewrite . import Git . migrate --include-ref import . migrate . --no-rewrite - . --no-rewrite : -m , --message= . [file ...] . gitattributes . --message . . EXPORT export Git LFS Git Git LFS . migrate : --verbose oid STDOUT . --object-map= path . CSV : OLD-SHA,NEW-SHA --remote= export LFS git-remote . origin . export --include export . --include Git LFS --exclude Git LFS . export .gitattributes . (INCLUDE AND EXCLUDE) git lfs migrate (pathspec) (glob) --include --exclude . . .gitattributes . ( .gif) path/* . --include --exclude git lfs migrate git lfs . git lfs ls-files gitignore(5) . (INCLUDE AND EXCLUDE REFERENCES) git lfs migrate --include-ref --exclude-ref . D---E---F / \ A---B------C refs/heads/my-feature \ \ \ refs/heads/main \ refs/remotes/origin/main : refs/heads/main: C, B, A refs/heads/my-feature: F, E, D, B, A refs/remote/origin/main: A git lfs migrate F E D C B A : --include-ref=refs/heads/my-feature --include-ref=refs/heads/main --exclude-ref=refs/remotes/origin/main --everything ( ). (EXAMPLES) (Migrate unpushed commits) migrate Git LFS (push) . non-bare . git lfs migrate info : $ git lfs migrate info Fetching remote refs: ..., done Sorting commits: ..., done Examining commits: 100% (1/1), done *.mp3 284 MB 1/1 files(s) 100% *.pdf 42 MB 8/8 files(s) 100% *.psd 9.8 MB 15/15 files(s) 100% *.ipynb 6.9 MB 6/6 files(s) 100% *.csv 5.8 MB 2/2 files(s) 100% git lfs migrate import LFS : $ git lfs migrate import --include="*.mp3,*.psd" Fetching remote refs: ..., done Sorting commits: ..., done Rewriting commits: 100% (1/1), done main d2b959babd099fe70da1c1512e2475e8a24de163 -> 136e706bf1ae79643915c134e17a6c933fd53c61 Updating refs: ..., done Git LFS git lfs checkout . (Migrate local history) : # Git LFS $ git lfs migrate info --include-ref=main # Git LFS $ git lfs migrate info --everything # Git LFS # $ git lfs migrate info --everything --pointers=ignore --top=100 import : # zip $ git lfs migrate import --include-ref=main --include="*.zip" # zip $ git lfs migrate import --everything --include="*.zip" # 100K $ git lfs migrate import --everything --above=100Kb : force-push Git . --all force-push ( import Git LFS --everything) . ( migrate import --no-rewrite) . Git LFS : $ git lfs track "*.zip" "*.mp3" "*.psd" $ git add .gitattributes $ git commit -m "add Git LFS attributes" $ git lfs migrate import --no-rewrite --yes test.zip audios/*.mp3 images/*.psd .mp3 .psd () (shell) git lfs migrate import. . Git LFS : $ git lfs track "*.zip" "*.mp3" "*.psd" $ git add .gitattributes $ git commit -m "add Git LFS attributes" $ git lfs migrate import --no-rewrite --yes \ -m "Import test.zip, audios/*.mp3, and images/*.psd files" \ test.zip audios/*.mp3 images/*.psd .mp3 .psd git lfs migrate import. --no-rewrite ( ) . . POSIX macOS Git Bash find(1) sed(1) : $ git lfs migrate import --no-rewrite --yes \ $(find . -name "*.zip" -o -name "*.mp3" -o -name "*.psd" | sed "s/^\.\///") git lfs track Git <<>> (dirty) Git LFS . git lfs migrate import --yes . ( add --renormalize) git lfs migrate import --no-rewrite Git LFS Git 2.16.0 --renormalize git add . : $ git lfs track "*.zip" "*.mp3" "*.psd" $ git add .gitattributes $ git add --renormalize . $ git commit -m "Import all *.zip, *.mp3, and *.psd files to Git LFS" Git LFS (Migrate from Git LFS) Git LFS export Git LFS blob Git . export pathspec --include Git origin --remote . # Git LFS zip $ git lfs migrate export --include-ref=main --include="*.zip" # Git LFS zip # my-remote $ git lfs migrate export --everything --include="*.zip" --remote=my-remote # Git LFS $ git lfs migrate export --everything --include="*" : force-push Git . --all force-push ( export Git LFS --everything) . (SEE ALSO) git-lfs-checkout(1), git-lfs-ls-files(1), git-lfs-track(1), git-lfs-untrack(1), gitattributes(5), gitignore(5). git-lfs(1). GIT-LFS-MIGRATE(1)