Git: clone single branch
git clone -b mybranch --single-branch http://repo.com/repo.git
Related cards:
Git: Remove local branch
git branch -d the_local_branch
delete a local branch
git push origin --delete the_remote_branch [remove_the_local_branch]
remove a remote branch
alternatively, git push origin :the_remote_branch [remove_the_local_branch]
Git: undo deleted branch
Use git reflog
to find the SHA1 of commit of the branch. From that point, you can recreate a branch using:
git branch branchName <sha1>
Git: staging files
git add -A
stages All
git add .
stages new and modified, without deleted
git add -u
stages modified and deleted, without new
Git: resurrect staged, but not committed files
See all blobs and commits that are not committed
git fsck --lost-found
Look at the content of a dangling blob by SHA
git show blob_sha
Restore into a temporary file
git show SHA1 > temp.file
OPTIONAL
Force clean-up and compact
`gi...