-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathremove_lfs.txt
More file actions
54 lines (38 loc) · 835 Bytes
/
remove_lfs.txt
File metadata and controls
54 lines (38 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
https://github.com/git-lfs/git-lfs/issues/3026
fedor57
on Jan 5, 2019
Thanx, that helped me a lot while I was migrating from BitBucket to AWS CodeCommit. Some helpful hints:
- commit & push everything
- remove hooks
```
git lfs uninstall
```
- remove lfs stuff from .gitattributes
- list lfs files using
```
git lfs ls-files | sed -r 's/^.{13}//' > files.txt
```
- run git rm --cached for each file
```
while read line; do git rm --cached "$line"; done < files.txt
```
- run git add for each file
```
while read line; do git add "$line"; done < files.txt
```
- commit everything
```
git add .gitattributes
git commit -m "unlfs"
git push origin
```
- check that no lfs files left
```
git lfs ls-files
```
- remove junk
```
rm -rf .git/lfs
```
you're all done
(but unlinked junk is within BitBucket Git LFS storage still)