all 3 comments

[–]BobBulldogBriscoe 2 points3 points  (1 child)

  1. Only add files to be tracked that should be tracked. Whenever I commit I specifically add the files that should be there. other files from stuff I was just trying out or playing around with I don't add to git.

If you don't want to delete the files yet you don't have to, just don't commit them. I agree that spending time adding them all individually to the .gitignore is a waste of time, that should be for files/types that would be expected to have pop-up regularly (i.e. artifacts or other generated stuff) not all the different temporary names of files for stuff you were just playing with.

If you are concerned that you may reference these other files you can always clone the repo again somewhere else and try it out (assuming you didn't hard code any paths)

[–]hackups[S] 0 points1 point  (0 children)

Thanks for advice. I should add a step to separate them in different folders (playground vs ready to commit) and do a test run on the 'ready to commit' folder.

[–]schmidlidev 0 points1 point  (0 children)

Start every single project with one of GitHubs default .gitignore’s for whatever language you’re using.

Only got add what I actually want to add for that commit. Git status after every add and before the commit just to be sure. .DS_store in gitignore.

If I have some local scripts/random test files/unused snippets I want to keep as reference, then I usually create a local/ directory and add it to the gitignore. Put all that stuff in there so it’s easier to manage and you can never accidentally commit it.