Git cheats: Shallow clones & Submodule update

This commit is contained in:
Shadab Zafar 2015-08-03 17:45:38 +05:30
parent 6cf69bc190
commit 196875a828
1 changed files with 10 additions and 0 deletions

View File

@ -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 <remote-url>
# To unshallow a clone
git pull --unshallow