til/use-git.md

583 B

Use git

Prefer rebase when pull:

git pull --rebase

Clean outdated branches:

git fetch --prune origin

Push force safely:

git push --force-with-lease origin master

Shallow clone:

git clone --depth 1 ...

Add submodule:

git submodule add --depth 1 ...

First time pull repo with submodules:

git submodule update --init --recursive

Update submodules:

git submodule update --recursive --remote

Save usernames and passwords in ~/.git-credentials:

git config --global credential.helper store