From 196875a828ca6ac0b6e9ab00d08d5b6db21ac95a Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Mon, 3 Aug 2015 17:45:38 +0530 Subject: [PATCH] Git cheats: Shallow clones & Submodule update --- cheat/cheatsheets/git | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cheat/cheatsheets/git b/cheat/cheatsheets/git index 469ee5d..b5c142b 100644 --- a/cheat/cheatsheets/git +++ b/cheat/cheatsheets/git @@ -94,3 +94,13 @@ git diff --no-index path/to/file/A path/to/file/B # To pull changes while overwriting any local commits git fetch --all git reset --hard origin/master + +# Update all your submodules +git submodule update --init --recursive + +# Perform a shallow clone to only get latest commits +# (helps save data when cloning large repos) +git clone --depth 1 + +# To unshallow a clone +git pull --unshallow