Skip to content

Commit a3ae8a5

Browse files
committed
fix(publish): keep .git out of the published package
`.gitignore` starts with `.*` and then `!.git*` so that .gitignore, .github and .gitattributes stay tracked. moon publish reads the same file, and that negation was enough to pull the entire .git directory into the tarball — object database, index and reflogs included, which is the whole repository history. moonasgi shipped 303 entries, 224 of them .git; moonorm shipped 850. A .moonignore now scopes this to publishing: .git/ and the build directories are excluded there, and .gitignore keeps doing its job for git. It needs its own negation to be tracked, for the same reason .git* does. Signed-off-by: Leo Cheng (heke1228) <chengkelfan@qq.com>
1 parent 1fdac78 commit a3ae8a5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.*
22
!.git*
3+
!.moonignore
34
_build/
45
target/
56

.moonignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# What `moon publish` must leave out of the package. `.gitignore` keeps `!.git*`
2+
# so that .gitignore/.github/.gitattributes stay tracked, but that same negation
3+
# would otherwise pull the whole `.git` directory — object database included —
4+
# into the published tarball.
5+
.git/
6+
_build/
7+
target/

0 commit comments

Comments
 (0)