Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15530757
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: 嵌入式

2011-02-08 17:02:57

如何给android的mirror加入自定义project对应的git库,让repo自动管理

修改manifests基本project配置
luther@gliethttp:/vobs/git_repos/android-pub-manifests$ git show
-           fetch="git://android.git.kernel.org/"
+           fetch="git://10.0.67.68/android"



一.luther@gliethttp:~$ git init sandbox.gliethttp
二.luther@gliethttp:~$ git clone --bare -l sandbox.gliethttp/.git /vobs/git_repos/android/sandbox.git
三.luther@gliethttp:/vobs/works/android-pub/sandbox$ git push korg :master
remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error:
remote: error: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: error: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: error: current branch, with or without a warning message.
remote: error:
remote: error: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To git://10.0.67.68/android/sandbox.git
 ! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'git://10.0.67.68/android/sandbox.git'

四.问题在于当前处于(no branch),
git branch -a
* (no branch)
  master
  remotes/korg/master
  remotes/m/android-2.3.2_r1 -> korg/master
必须要有一个branch,比如可以在pool上进行push,语句如下:
git checkout -b pool
git push korg pool:master
五.需要现切换到master才行
git checkout master
六.但是push时会出现另一个错误
luther@gliethttp:/vobs/works/android-pub/sandbox$ git push
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (7/7), 606 bytes, done.
Total 7 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit
To git://10.0.67.68/android/sandbox.git
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'git://10.0.67.68/android/sandbox.git'
七.解决方式就是修改权限
luther@gliethttp:~$ sudo chmod o+w /vobs/git_repos/android/sandbox.git -R
八.成功推入到android下自己添加的git库
luther@gliethttp:/vobs/works/android-pub/sandbox$ git push
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (7/7), 606 bytes, done.
Total 7 (delta 0), reused 0 (delta 0)
To git://10.0.67.68/android/sandbox.git
   f7c2a14..2986a8d  master -> master
阅读(5037) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~