The .DS_Store file is sometimes automatically created on MacOS systems. There is ZERO need to save it in the source code.
The purpose of this chapter is to remove instances of the .DS_Store file and to make sure that the Mac users working on this Rails app do not accidentally add any.
.DS_Store File
Use the SearchMonkey tool to search the Rails app's source code to see if there are any instances of the file .DS_Store in it. If there are any, you must go through the rest of this chapter.
Check the .gitignore file for the presence of a line consisting SOLELY of ".DS_Store". If the .DS_Store file is listed here AND there are no instances of .DS_Store in the source code, then you may skip the actions in the rest of this chapter.
Procedure
From the root directory of your app, enter the command "git checkout -b ds_store".
Use the SearchMonkey tool to search the Rails app's source code to see if there are any instances of the file .DS_Store in it. If you find any .DS_Store files, delete them.
If you removed any .DS_Store files, enter the following commands:
If all goes well, the "git status" command should show no changes. Otherwise, you need to add ".DS_Store" to the the .gitignore file.
Enter the command "git status". If all goes well, it shows no instances of .DS_Store being added. (If you had to add .DS_Store to the .gitignore file, this change will be reflected by a changed .gitignore file.)
Enter the command "rm .DS_Store; rm app/.DS_Store".
Enter the command "git status". If you didn't have to make any changes to the source code in this chapter to keep the .DS_Store files out of the source code, do the following:
Enter the command "git checkout ruby_on_racetracks".
Skip the rest of this chapter and move on to the next chapter.
Enter the command "git log". Record the checksum numbers of all of the commits you made during this chapter.
Enter the command "git checkout master; git checkout -b pr_ds_store". (The "pr" stands for pull request.)
For each of the commits you made in this chapter (starting with the first one), enter the following command:
git cherry-pick <checksum number>
Your pr_ds_store branch now contains all of the changes you made in this chapter but excludes the change you made during the previous chapter. (Thus, the pr_ds_store branch omits the credentials.sh script.)
Enter the command "git push origin pr_ds_store".
Submit a pull request of the pr_ds_store branch. If you are a collaborator, you can accept it.
Return to the ruby_on_racetracks branch by entering the command "git checkout ruby_on_racetracks".