1.先在GitHub上创建repository,取名为UISearchBarDemo,然后通过git pull命令下拉到本地
git pull https://github.com/hengyizhangcn/SearchBarDemo.git
2.在终端cd一个文件夹,输入git init命令,可以当前文件夹为git目录
3.添加要提交的文件
git add SearchBarDemo SearchBarDemo.xcodeproj/ SearchBarDemoTests/
4.然后设置提交类型
git commit -m "first commit"
(第一次提交-----注释里是log)5.添加要提交项目的git地址
git remote add origin https://github.com/hengyizhangcn/SearchBarDemo.git
6.设置用户名和密码
git push -u origin master
用master账户提交,输入用户名、密码,就会执行提交操作