1. 先在服务器上建立目录
mkdir tbox/buildroot.git
cd tbot/buildroot.git
git init --bare .git
mkdir tbox/manifest.git
cd tbox/manifest.git
git init --bare .git
2.本地机操作
mkdir buildroot
cd buildroot
git init
//add some file
git add *
git commit -m "ddd"
git remote add master yjgit@192.168.4.229:/home/yjgit/repositories/tbox/buildroot.git
git push master --all
3. 建立repo仓库。repo实际上就是一个git仓库+管理git仓库的repo脚本
mkdir manifest
cd manifest
编辑default.xml:
git add *
git remote add master yjgit@192.168.4.229:/home/yjgit/repositories/tbox/manifest.git
git push master --all
4. 同步
mkdir ddd
cd ddd
repo init -u yjgit@192.168.4.229:/home/yjgit/repositories/tbox/7x9/manifest.git --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable
repo sync
其中,--repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable 参数可以解决GW问题
5. Git和Repo中的常用命令
repo start
repo forall -c "git status"