RHEL/Android/Git/repo switch branch in AOSP source

54 篇文章 0 订阅
7 篇文章 0 订阅

lake@localhost:~/Google/android-8.1.0_r33$cd .repo/manifests


lake@localhost:~/Google/android-8.1.0_r33/.repo/manifests$ git branch -a | grep   android-8.1.0_r33
  remotes/origin/android-8.1.0_r33
lake@localhost:~/Google/android-8.1.0_r33/.repo/manifests$  git branch -a | cut -d / -f 3  ## see all tags 

######## new branch is in local already


lake@localhost:~/Google/android-8.1.0_r33$ repo init -b  android-8.1.0_r33
.repo/manifests/: discarding 484 commits

Your identity is: Lake <lake.hu@outlook.com>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /home/lake/Google/android-8.1.0_r33

lake@localhost:~/Google/android-8.1.0_r33$   repo forall -p -c git checkout  android-8.1.0_r33
lake@localhost:~/Google/android-8.1.0_r33$   repo forall -p -c 'git reset --hard; git clean -f -d -x'     ### Clean all local changes

### --trace   -p  for detail 

 

#########  new branch is NOT in local yet


lake@localhost:~/Google/android-8.1.0_r33$ repo init -u https://android.googlesource.com/platform/manifest -b android-8.1.0_r33

lake@localhost:~/Google/android-8.1.0_r33$  repo forall  -p -c 'git reset --hard; git clean -f -d -x'   ### Clean all local changes

### --trace  for detail 

lake@localhost:~/Google/android-8.1.0_r33$ repo sync  -j32
.......................
Fetching projects: 100% (591/591), done.  
Deleting obsolete path /home/lake/Google/android-8.1.0_r33/external/libvorbis
Syncing work tree: 100% (591/591), done.  

device/asus/fugu-kernel/: discarding 1 commits
device/google/dragon-kernel/: discarding 1 commits
device/google/marlin-kernel/: discarding 1 commits
device/google/wahoo-kernel/: discarding 1 commits
device/huawei/angler-kernel/: discarding 1 commits
device/lge/bullhead-kernel/: discarding 1 commits
external/chromium-webview/: discarding 1 commits
prebuilts/abi-dumps/vndk/: discarding 1 commits
prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/: discarding 1 commits
prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.9/: discarding 1 commits
prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9/: discarding 1 commits
prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/: discarding 1 commits
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/: discarding 1 commits
prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/: discarding 1 commits
prebuilts/gradle-plugin/: discarding 1 commits
prebuilts/maven_repo/android/: discarding 1 commits
prebuilts/ndk/: discarding 1 commits
prebuilts/qemu-kernel/: discarding 1 commits
prebuilts/sdk/: discarding 1 commits
prebuilts/tools/: discarding 1 commits 

### --trace  for detail 


############# start a local repo branch for all git projects !!  ########### Attention the branch name

lake@localhost:~/Google/android-8.1.0_r33$  repo start  android-8.1.0_r33    --all   

####  'android-8.1.0_r33'  will be  ambiguous
Starting android-8.1.0_r33: 100% (591/591), done.  
lake@localhost:~/Google/android-8.1.0_r33$ 

  
lake@localhost:~/Google/android-8.1.0_r33$ repo branches
*  android-8.1.0_r33         | in all projects
lake@localhost:~/Google/android-8.1.0_r33$ 

 

####  'android-8.1.0_r33'  will be  ambiguous in branch name and tag name

You can explicitly specify whether you want a branch or a tag by using full name:

 git checkout refs/heads/android-8.1.0_r33
or

git checkout refs/tags/android-8.1.0_r33

lake@localhost:~/Google/repo-aosp-AndroidN7.1.x-8.1$ repo branch 
*  android-8.1.0_r33         | in all projects

 

repo forall -c git checkout  refs/tags/android-8.1.0_r33   <<<<<<< ---------- Checkout tag of android-8.1.0_r33

repo forall -c git branch  -D  android-8.1.0_r33 <<<<<<< ---------- delete all branches of android-8.1.0_r33 to avoid ambiguous

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值