git Notes

This page needs some formatting, but includes useful git information

Submodules

Add a new submodule in existing repo

git submodule add <url for repo> [directory for submodule]

Update submodules in newly cloned repo

git submodule update --init --recursive

Update submodule remote url

git submodule set-url -- <submodule path> <url for repo>

Commits

Update commit message of most recent commit

git commit --ammend

Remotes

Add remote

git remote add <REMOTE_NAME> <REMOTE_URL>

Update remote URL

git remote set-url <REMOTE_NAME> <REMOTE_URL>

Remove remote

git remote remove <REMOTE_NAME>

Push to specified remote

git push <REMOTE_NAME>

Pull from specified remote

git pull <REMOTE_NAME>

Push tag to remote

git push <remote> tag <tag name>

Other

Store credentials

NOTE: This will store credentials in plaintext on your disk

git config --global credential.helper store