Tips and Tricks for Git

Git Submodules

// 1. Add submodule to a new repo
git submodule add
// 2. Updating repo with new submodule
git pull
git submodule update --init --recursive
// 2. Or Cloning repo with new submodule
git clone --recurse-submodules
// 3. Pulling repo with submodules
git pull --recurse-submodules

by git

Delete branch locally and remotely

// 1. locally
git branch -d localBranchName
// 2. remote
git push origin :remoteBranchName

by FreeCodeCamp

Apply .gitignore to committed files

// Edit your .gitignore with the file to ignore and run
git rm --cached /path/to/file

by SO

Git ignore file mode (chmod) changes

// Only current repo
git config core.fileMode false
// General
git config --global core.fileMode false

by SO