如今apple官网下载Command Line Tools 对应mac版本和xcode版本,记录地址:https://developer.apple.com/downloads/git
找到mac的终端,command+空格,搜索"终端",进入后,输入以下命令:xcode
cd 项目根目录 //进入到项目根目录app
git init //初始化本地代码库code
git add . 或者 git add -A //添加要提交的文件,这里添加全部get
git commit -m "first commit" //备注第一次提交it