Skip to content

Instantly share code, notes, and snippets.

@nobk
nobk / gist:4fd2b8517a38c1479b08a5ecb08319cc
Last active March 27, 2021 11:54
pack modified files tracked by git in to compress archive
If we need pack all working files(maybe modifed), not the commited git files.
# ensure pwd is git root dir
git ls-files | tar -T - -cf - | lzip -9q > /tmp/master.tar.lz
@nobk
nobk / git-partial-clone.sh
Last active January 8, 2022 19:41
git partial clone filtering directories
REPONAME="knew"
OLDFULLREPO="k8"
git init $REPONAME
cd $OLDFULLREPO
ls -1 > ../${REPONAME}/.git/info/sparse-checkout
GITURL="$(git remote show origin | awk '/Fetch URL/ {print $3}')"
cd ../$REPONAME
nano .git/info/sparse-checkout # remove unwanted dirs
git config --local core.sparsecheckout true
git remote add origin "$GITURL"
@nobk
nobk / .zshrc
Last active January 3, 2024 19:11
My light weight zshrc for WSL2 and Gentoo and MSYS2 and OpenWRT zsh shell
# z's config for the zsh
# Install: curl -o $HOME/.zshrc -L https://tinyurl.com/nobk-zshrc
TERM=xterm-256color
# Load user rc script
[ -f "$HOME/.zsh_user.zsh" ] && source "$HOME/.zsh_user.zsh"
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000