Monday, 10 October 2016

Git repo that tracks only the head commit of a branch

Quick note to self on how to have a git repo that only contains a single commit, the head of a branch.

Initiate it with:

git clone <url> --branch <branch_name> --depth=1

Update it with:

git pull && git pull --depth=1 && git reflog expire --expire-unreachable=now --all

No comments:

Post a Comment