iOS 如何利用 git 命令将项目提交至代码库

那就以我本地的 自定义tabbar 项目为案例
第一步:
cd 到项目的根目录

liuyaozong@liuyaozongdeMacBook-Pro ~ % cd /Users/liuyaozong/Desktop/iOSTest/CustomTabbar     

2: 提交至缓冲区

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git add .

3:提交

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git commit -m '初始化' 

4: 链接远程仓库

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git remote add origin https://github.com/liuyaozong1/CustomTabbar.git

5.切换到指定分支

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git checkout -b main

6:可以通过如下命令进行代码合并

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git pull --rebase origin main  

7:push 提交

liuyaozong@liuyaozongdeMacBook-Pro CustomTabbar % git push origin main -f
提交成功.png

github.png

你可能感兴趣的:(iOS 如何利用 git 命令将项目提交至代码库)