I just find a post https://stackoverflow.com/a/11021627/411936 which solves this problem.
I worked for me. Hope it helps.
1. Quit Xcode (not sure if this is necessary but I do it just in case)
2. Run Terminal
3. Get into the project folder directory
4. find .
5. Find the file that says "UserInterfaceState.xcuserstate" and copy the entire filename up to the ./
6. echo "paste the UserInterfaceState.xcuserstate file here" >.gitignore
7. cat .gitignore
8. git init
9. git add .
10. git commit -m "You can type a comment here like now under source control"
You now have a repository and your project is under source control