Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I was trying to get .DS_Store files to be globally ignored by git.

I must have entered some command incorrectly because now every time I launch terminal or use the cd command, I get six lines of -bash: .DS_Store: command not found, like so:

[11:28:30] [~]$ cd Projects/
-bash: .DS_Store: command not found
-bash: .DS_Store: command not found
-bash: .DS_Store: command not found
-bash: .DS_Store: command not found
-bash: .DS_Store: command not found
-bash: .DS_Store: command not found
[11:28:33] [Projects]$

Obviously, DS_Store is not supposed to be a command.

How do I fix this?


I don't remember exactly every command I ran. I was googling, and trying stuff. I know I did execute the commands found here.

git config --global core.excludesfile ~/.gitignore

echo .DS_Store >> ~/.gitignore

EDIT 2: I figured it out. Answer provided below.

share|improve this question
What steps did you take to get git to ignore .DS_Store files? – fideli Jan 5 '12 at 16:39
@Pitto No. Please don't suggest that. The question is perfectly on-topic here. If a question about an Apple product is on topic for Super User as defined in the the FAQ, then it should stay on Super User. – slhck Jan 5 '12 at 16:41
What is the content of your ~/.bashrc and ~/Project/.git/config file? Did you create a .gitignore file? Show them all please. – user111228 Jan 5 '12 at 16:42
What does history show? Can you tell us what you did using the history output? Did you ever change ~/.bashrc or ~/.bash_profile? – slhck Jan 5 '12 at 16:42

I figured it out. At some point I ran echo .DS_Store >> ~/.rvmrc a couple times. My .rvmrc file looked like this:

export rvm_path="/Users/myname/.rvm"

I removed the two .DS_Store lines and everything is behaving properly.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .