1.调出终端,cd到项目位置,如cd Documents/xxx 2.git init 3.git add . (千万不要少打.号) 4.git commit -m "Initial commit" //通常直接这样配置就完了,但若是系统中安装了多个xcode。执行 git init 可能会出错,这时,你须要代开xcode->preference->location->Comman Line TOoLs 修改成当前使用的Xcode版本,否则上面配置不上。