What should I gitignore? Can I gitignore cmake-build-debug?

已回答

Me and my friends are trying to code in team, using gitlab repository.
I created project, imported it from CLion and then connected it to repository using "git remote add origin"
However, we don't know what we can add to .gitignore. All google search only lead us to answer that we should ignore .idea/workspace.xml, but nothing is said about cmake-build-debug directory, which contains a lot of local information, and when I accidentally updated project, I wasn't able to compile my project because my friend's local folders, settings, etc. were everywhere in files this folder. However, when I deleted this folder, I wasn't able to compile project either.
So, what should I do to safely commit code, without risk of destroying my friend's local project?
Or how should I use git, if I'm using it wrong?

0

Yes, you can (and probably should) either add `cmake-build-debug` to .gitignore or change CMake generation path so it'll point outside of the project.

1
Avatar
Permanently deleted user

Anna, thank you! I also figured out that if project lacks this folder after clone, it can be easily re-created after reloading CMake project.

0

请先登录再写评论。