You can create a file called ".gitignore" in the root of the repository with the following contents:
*.yml
*.log
To make git ignore changes to files matching the pattern. To remove your already existing copies of .yml files and .log files, you'd do this:
rm *.yml *.log
git rm *.yml *.log
git commit -m "removed .yml and .log files"
If you don't want to remove the .yml files (assuming they are configuration files of sort), you can add them to .gitignore, but still git-add a default one for the repository. If anyone were to change their .yml files, git would ignore the changes.
If you want everyone to have the same .gitignore file, add it to the repo as well. If you want everyone to be able to freely configure their .gitignore file for their own purposes, you can add ".gitignore" to the .gitignore file.