Curtis "Ovid" Poe on Nostr: Sometimes you want to just have an empty directory in git, but not commit any files ...
Sometimes you want to just have an empty directory in git, but not commit any files in it.
touch data/.gitkeep
And add this to your .gitignore:
data/*
!data/.gitkeep
Then commit. Now you have an "empty" directory.
#git #programming
Published at
2024-12-28 09:07:53Event JSON
{
"id": "acbb5de643624d0a69abba0be9c82fc9af4bcfcba173f50044c92f8b3a08956b",
"pubkey": "a7426b90eef0ab497ad455a51e4896a6ad0a3ddee0f8a91e488341cd4841e4f3",
"created_at": 1735376873,
"kind": 1,
"tags": [
[
"t",
"git"
],
[
"t",
"programming"
],
[
"proxy",
"https://fosstodon.org/users/ovid/statuses/113729658758619369",
"activitypub"
]
],
"content": "Sometimes you want to just have an empty directory in git, but not commit any files in it.\n\n touch data/.gitkeep\n\nAnd add this to your .gitignore:\n\n data/*\n !data/.gitkeep\n\nThen commit. Now you have an \"empty\" directory.\n\n#git #programming",
"sig": "dc6ba9b45572394935e0d9e29552b0bd11f998622ba124f0d316cf1ea1bfc1890e45f867c763b1271c11b41e13e28007a697193953ab435148b762b6b2a281ca"
}