repo

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2025 License: MIT Imports: 7 Imported by: 0

README

repo

Build Status Go Report Card License Tag

Introduction

repo with copy-on-write

Prerequisites

  • Go >= 1.24.0

Usage

Usage:
  repo [flags]

Flags:
  -h, --help              help for repo
  -n, --manifest string   manifest file (user@host:/remote/manifest.xml:/local/manifest.xml)
  -m, --mount string      mount path
  -s, --sshkey string     sshkey file (/path/to/id_rsa)
  -u, --unmount string    unmount path
  -v, --version           version for repo

Example

1. Overlay
Preparation
cd /path/to/aosp

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
export AOSP_MANIFEST='https://github.com/repo-scm/manifest'

repo init --partial-clone -b main -u $AOSP_MANIFEST --manifest-depth=1 -c --depth=1 -b main
repo sync -c -j4 --fail-fast
repo manifest -o manifest.xml
Mount
sudo ./repo --mount /mnt/overlay/aosp --manifest /path/to/aosp/manifest.xml

sudo chown -R $USER:$USER /mnt/overlay/aosp
sudo chown -R $USER:$USER /path/to/cow-aosp
Test
cd /mnt/overlay/aosp/system/core

echo "new file" | tee newfile.txt
echo "modified" | tee README.md

git commit -m "repo changes"
git push origin main
Unmount
sudo ./repo --unmount /mnt/overlay/aosp --manifest /path/to/aosp/manifest.xml
Screenshot

overlay

2. SSHFS and Overlay
Preparation
ssh user@host:/remote/aosp

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
export AOSP_MANIFEST='https://github.com/repo-scm/manifest'

repo init --partial-clone -b main -u $AOSP_MANIFEST --manifest-depth=1 -c --depth=1 -b main
repo sync -c -j4 --fail-fast
repo manifest -o manifest.xml

exit
Config
cat $HOME/.ssh/config
Host *
    HostName <host>
    User <user>
    Port 22
    IdentityFile ~/.ssh/id_rsa
Mount
sudo ./repo --mount /mnt/overlay/aosp --manifest user@host:/remote/aosp/manifest.xml:/local/manifest.xml --sshkey /path/to/id_rsa

sudo chown -R $USER:$USER /mnt/overlay/aosp
sudo chown -R $USER:$USER /path/to/cow-aosp
Test
cd /mnt/overlay/aosp/system/core

echo "new file" | tee newfile.txt
echo "modified" | tee README.md

git commit -m "repo changes"
git push origin main
Unmount
sudo ./repo --unmount /mnt/overlay/aosp --manifest /local/manifest.xml
Screenshot

sshfs-overlay

License

Project License can be found here.

Reference

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL