PPC Wiki

Home

❯

u

❯

c2vi

❯

git clone subpath

git clone subpath

Jun 19, 20251 min read

  • t/project/pkging
  • t/docs

ref: https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository

first arg: repo url seccond arg: dir to clone into all following args: paths to be checked out from the repo

function git_sparse_clone() (
	rurl="$1" localdir="$2" # all following args are paths to checkout from the repo
 
	mkdir -p "$localdir"
	
	git clone -n --depth=1 --filter=tree:0 "$rurl" "$localdir"
	cd $localdir
	git sparse-checkout set --no-cone $@
	git checkout
)

Graph View

Backlinks

  • building alpine package

Created with Quartz v4.5.1 © 2025

  • GitHub
  • Discord Community