repo提交流程

版权声明:转载请注明,谢谢。 https://blog.csdn.net/u012899335/article/details/85369433

repo是android为管理git库开发的python脚本。android源码有众多的git库,使用repo管理这些git库很方便。

1、拉代码

repo init xxx.xml  下载repo并克隆manifest,此命令一般由spm给出,直接执行即可。

repo sync  下载代码,由于android源码非常多,所以此过程可能需要很长时间。

2、新建分支并切换分支到新建的分支

repo start branch-name --all

3、代码提交

git add file_name

git commit -m "comment"

repo upload path_name

切换到有代码修改的目录,如果是新加的需要执行git add将其添加到暂存区,然后执行git commit提交修改到本地分支,然后回到根目录执行 repo upload, 将本地分支推到远程服务器,如果repo upload后面没有加目录,则默认是整个根目录,由于android源码巨大,此过程比较慢,建议加具体目录。

下面分享一下我自己从修改代码到推到远程服务器的过程。

a.本地没有代码

repo init xxx.xml

repo sync -j8

repo start branch-name --all

修改代码

git status

git add

git commit -m "comment"

repo upload path_name

b.本地已有代码,需要先新建分支,同步远程服务器代码

repo start branch-name --all

repo sync -j8

修改代码

修改代码

git status

git add

git commit -m "comment"

repo upload path_name

注:有时候编译时候发现明明修改的代码却没有生效,可能是因为本地编译已经生成的中间文件没有重新生成导致,之前查别人提交分支时出现过。建议make clean,使本地代码与服务器代码完全一致,可参考如下命令:

repo forall -c "git clean -df" && repo forall -c "git checkout ." && repo sync -j8

猜你喜欢

转载自blog.csdn.net/u012899335/article/details/85369433