1. 服务器版本下载:
1、repo init -u ssh://xxx/platform/manifest.git -b branch-name
2、repo sync
3、repo start branch-name --all
或者:
git clone ssh://xxx.git
git checkout -b branch-name
2. 服务器新加仓库同步:
1:~> cd your_repo_path
2: git pull --rebase
3. 上传本地修改到服务器
repo forall -c git add .
repo forall -c git reset --hard
repo forall -c git pull --rebase 和服务器同步(要上传代码前,一般先进行此操作)
git add . 或 git add 文件名 添加当前仓库修改的文件
git commit -m "..." 在引号中添加你的修改记录
git push 上传本地修改的代码
4. 设置一些默认的全局变量,对所有工程代码有效
git config --global user.name yourmail
git config --global user.email yourmail
git config --global push.default tracking 这样后续git push 后面不用带参数
5.查看修改记录
git log 本地仓库修改记录
repo forall -c git log --since="2013-01-01" --until="2013-09-24" 按条件查看工程所有仓库修改记录
repo status 查看工程中所有仓库的修改状态(包括文件位置)
git status 查看仓库修改状态
6. 分支相关
git branch 查看本地branch
git branch -r 查看远程branch
git branch -a 查看所有branch
git branch -D (-d) (branch name) 删除branch
7、代码编译
source ./build/envsetup.sh
lunch xxx-eng
mmm packages/apps/Gallery2/