如今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