iOS上传本地代码到git

时间:2023-03-09 22:35:23
iOS上传本地代码到git

1.顾名思义,首先你得注册一个github账户 这个我就不细说了。

2.然后你得创建一个 repository  步骤见下图

iOS上传本地代码到git

iOS上传本地代码到git

3.相当于创建成功 会跳到下图界面

iOS上传本地代码到git

4.一看就很清楚了

create a new repository on the command line 意思就是让你把下面的命令行在终端安装顺序执行就可以了,最后你刷新就会看到已经上传好的项目文件了。

以下是网上搜罗的git 常用命令

更新代码

cd /d/TVCloud
git add .
git commit -m "update test" //检测文件改动并附加提交注释
git push -u origin master //提交修改到项目主线

github常用命令

git push origin master //把本地源码库push到Github上
git pull origin master //从Github上pull到本地源码库
git config --list //查看配置信息
git status //查看项目状态信息
git branch //查看项目分支
git checkout -b host//添加一个名为host的分支
git checkout master //切换到主干
git merge host //合并分支host到主干
git branch -d host //删除分支host