Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Last active April 5, 2017 12:23
Show Gist options
  • Save paveltimofeev/4a431086b68b3c0a0bfc to your computer and use it in GitHub Desktop.
Save paveltimofeev/4a431086b68b3c0a0bfc to your computer and use it in GitHub Desktop.
Git hints & Tricks

Git hints & Tricks

# GET | PULL ONLY ONE CONCRETE FILE FROM ANY BRANCH
git fetch
git checkout -m <revision> <yourfilepath>

How to switch from --single-branch mode to all branches

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin

How to remove submodule

export SUB_MOD=path/to/sub-module

git submodule

mv $SUB_MOD $SUB_MOD"_tmp"
git submodule deinit $SUB_MOD    
git rm $SUB_MOD
git rm --cached $SUB_MOD
rm -rf .git/modules/$SUB_MOD
rm -rf $SUB_MOD

git submodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment