Android 向AOSP回购协议中添加新git

Android 向AOSP回购协议中添加新git,android,git,android-source,repo,Android,Git,Android Source,Repo,我在$AOSP\u ROOT/device/下创建了一个新设备mydevice/。我试图将git添加到$AOSP_ROOT/.repo中以进行本地跟踪,我发现如果在执行repo status或repo diff时可以看到更改,那么它将非常有用。以下是我尝试的步骤: 在mydevice文件夹中执行git init,保留未提交的更改 将项目添加到$AOSP_ROOT/.repo/manifest.xml 不幸的是,当我执行repo status时,我的项目没有反映在输出中。我做错了什么 假设$HOM

我在
$AOSP\u ROOT/device/
下创建了一个新设备
mydevice/
。我试图将git添加到
$AOSP_ROOT/.repo
中以进行本地跟踪,我发现如果在执行
repo status
repo diff
时可以看到更改,那么它将非常有用。以下是我尝试的步骤:

  • mydevice
    文件夹中执行
    git init
    ,保留未提交的更改
  • 将项目添加到
    $AOSP_ROOT/.repo/manifest.xml

  • 不幸的是,当我执行
    repo status
    时,我的项目没有反映在输出中。我做错了什么

    假设
    $HOME
    /HOME/consy/
    $AOSP_ROOT
    /HOME/consy/AOSP/

    #init a local bare repo as the remote repo of `mydevice`
    cd $AOSP_ROOT/device/
    git init mydevice
    git commit --allow-empty -m 'init repository'
    cd $HOME
    git clone $AOSP_ROOT/device --bare -- mydevice.git
    cd $AOSP_ROOT/device
    rm -rf mydevice
    
    #create .repo/local_manifests (this is a feature of repo)
    mkdir -p $AOSP_ROOT/.repo/local_manifests
    
    #create a manifest under `local_manifests`.
    #You can name it whatever you like except that the manifest's content should be like:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <remote fetch="file:///home/consy/" name="this"/>
      <default remote="this" revision="master"/>
      <project name="mydevice" path="device/mydevice"/>
    </manifest>
    
    #将本地裸repo初始化为“mydevice”的远程repo`
    cd$AOSP_根目录/设备/
    git init mydevice
    git提交--允许空-m'init repository'
    cd$HOME
    git clone$AOSP_ROOT/device--bare--mydevice.git
    cd$AOSP_根目录/设备
    rm-rf设备
    #create.repo/local_清单(这是repo的一个功能)
    mkdir-p$AOSP_ROOT/.repo/local_清单
    #在“本地清单”下创建清单。
    #您可以随意命名,但清单的内容应如下所示:
    
    现在,当您运行
    repo sync
    时,本地清单中定义的项目将作为额外项目添加到
    $AOSP_ROOT
    中。您可以使用repo命令,如
    repo status
    来操作这些额外的项目。存储库将从
    /home/consy/mydevice.git
    克隆,并签出到
    $AOSP\u ROOT/device/mydevice
    。在
    $AOSP_ROOT/device/mydevice
    下进行新提交后,可以运行
    git推送此:
    将提交上载到
    /home/consy/mydevice.git
    。稍后,当您认为可以将此新存储库发布到真正的主机(如Github或您自己的Gerrit)时,您可以添加一个指向Github或Gerrit的新远程设备,并将其推送过去。然后将项目定义
    添加到您在
    repo init
    时使用的主清单中,提交更改,并推送到远程清单存储库。之后,您可以删除
    $AOSP_ROOT/.repo/local_manifests
    下的本地清单,以避免重复的项目错误

    有关本地清单功能的详细信息,请参见
    
    
    本地舱单
    位于。如果无法访问该链接,google
    repo manifest format

    我将收到一个
    致命错误:在/home/XXXXX/aosp/.repo/manifest.xml中重复默认值
    -我如何解决此问题?@HyperionX Search
    .repo/manifest.xml
    查看是否有两个或更多