You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git LFS allows uses to commit new files to the LFS store, but replacing
_old_ files requires rewriting history, which is something the BFG is
pretty good at. This rough cut allows replacing blobs with pointer files
throughout repo history.
Some caveats with this initial implementation:
* the BFG cleans concurrently, files may unnecessarily be hashed more than once
* the working directory isn't updated
* specifying `-fi *.png` should be unnecessary, should use gitattributes
* need for `--no-blob-protection` is a hangover from normal BFG behaviour
Example invocation:
```
$ git clone https://github.com/guardian/membership-frontend.git
$ cd membership-frontend
$ java -jar bfg.jar --convert-to-git-lfs -fi *.png --no-blob-protection
...
$ ls .git/lfs/objects/ | head -2
0145f7c304ef33a43cc946e0a57b2213d24dcaf8462f3d3b332407a8b258369c
07010d5ddea536da56ebdbbb28386921c94abd476046a245b35cd47e8eb6e426
$ git reset --hard
$ cat frontend/assets/images/favicons/152x152.png
version https://git-lfs.github.com/spec/v1
oid sha256:0145f7c304ef33a43cc946e0a57b2213d24dcaf8462f3d3b332407a8b258369c
size 1935
$
```
https://git-lfs.github.com/https://github.com/github/git-lfs/blob/5eb9bb01/docs/spec.md#the-pointer
Copy file name to clipboardExpand all lines: bfg/src/main/scala/com/madgag/git/bfg/cli/CLIConfig.scala
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,9 @@ object CLIConfig {
74
74
fileMatcher("delete-folders").text("delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo)").action {
75
75
(v, c) => c.copy(deleteFolders =Some(v))
76
76
}
77
+
opt[Unit]("convert-to-git-lfs").text("experimental support for Git LFS, use with '-fi' to specify files").hidden().action {
78
+
(_, c) => c.copy(lfsConversion =true)
79
+
}
77
80
opt[File]("replace-text").abbr("rt").valueName("<expressions-file>").text("filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - "+
78
81
"by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with '==>' to specify a replacement "+
79
82
"string other than the default of '***REMOVED***'.").action {
@@ -129,6 +132,7 @@ case class CLIConfig(stripBiggestBlobs: Option[Int] = None,
0 commit comments