Don't create .gitkeep files, use .gitignore instead (2023)
1–10 of 101 posts
Re: Don't create .gitkeep files, use .gitignore instead (2023)
#2 touch build/.gitkeep
git add build/.gitkeep
git commit build/.gitkeep
And that's it? There's no need to exclude anything.Re: Don't create .gitkeep files, use .gitignore instead (2023)
#3I'm confused. Having a file gitignored doesn't stop you from committing it; AFAIK you can just touch build/.gitkeep git add build/.gitkeep git commit build/.gitkeep And that's it? There's no need to exclude anything.
Re: Don't create .gitkeep files, use .gitignore instead (2023)
#4Re: Don't create .gitkeep files, use .gitignore instead (2023)
#5I'm confused. Having a file gitignored doesn't stop you from committing it; AFAIK you can just touch build/.gitkeep git add build/.gitkeep git commit build/.gitkeep And that's it? There's no need to exclude anything.
The idea is that you don't want to check-in any builds.
Re: Don't create .gitkeep files, use .gitignore instead (2023)
#6Re: Don't create .gitkeep files, use .gitignore instead (2023)
#7Re: Don't create .gitkeep files, use .gitignore instead (2023)
#8Not sure why you can’t just have your build script create the build directory?
Re: Don't create .gitkeep files, use .gitignore instead (2023)
#9The author is misusing .gitkeep. I use it to keep source code folders that don’t contain any code yet, but whose structure is already defined.
Better yet just do the work. If you want make a commit in a branch that's destined to be squashed or something, sure, but keep it away from the shared history and certainly remove it when it's not needed anymore.