Skip to main content

Git

Writing Commit Messagesโ€‹

Interesting Readingโ€‹

Aliasesโ€‹

Aliases are managed through oh-my-zsh.

  • gcl: Clone
  • gl: Pull
  • gp: Push
  • gst: Git Status
  • gc: Commit

Push A Specific Commitโ€‹

git push origin <commit-id>:<branch>

Commit Signingโ€‹

Signing Commitsโ€‹

git config commit.gpgsign true
git config user.signingkey <key>

Verifying Commitsโ€‹

git verify-commit <commit-ref>

When a commit is signed, the signature is outputted and returns error code 0. When thereโ€™s no signature on the commit, the command outputs nothing and returns error code 1.

Submodulesโ€‹

Adding A Submoduleโ€‹

git submodule add <repo-url> <directory>

Cloning A Repository With Submodulesโ€‹

git clone <repo-url>
cd <repo>
git submodule update --init

Updating Submodules When Pullingโ€‹

git pull --recurse-submodules