Git

Snippets

# Stash particular file
git stash push -- path/to/folder

# Create and apply patch
git diff sha1..sha2 > mypatch.patch
git apply mypatch.patch

# Show changed files only
git diff --name-only sha1..sha2
git diff --name-status sha1..sha2

# Change submodule url
./gitmodules  # change url
git submodule sync
git submodule update --init --recursive --remote