Git can't add file
I have this file: Default (OSX).sublime-keymap and when I try git add Default (OSX).sublime-keymap I get the following error: sh: syntax error near unexpected token('` is there a workaround...or I need to rename the file...
There are two related problems with your use of the command line, neither of which is specific to Git:
- Parentheses need to be escaped. Your command line shell is actually an interpreter, and parentheses are significant to it.
- Spaces need to be escaped. Spaces separate commands and arguments. Assuming you've escape the parentheses, you're now passing two files to git add, one called "Default" and one called "(OSX).sublime-keymap".
You need to either use quotes around the whole filename, or escape the parentheses and spaces with backslashes:
git add "Default (OSX).sublime-keymap"
git add Default\ \(OSX\).submlime-keymap
Note that your shell may support tab-completion. Try typing git add Def and hitting tab a few times, and your shell may auto-complete the filename for you, correctly escaping the spaces and parentheses.