Skip to content

Instantly share code, notes, and snippets.

@jerdog
Last active January 30, 2023 21:58
Show Gist options
  • Save jerdog/70dc5a8c3cc1e00592470654a550ff46 to your computer and use it in GitHub Desktop.
Save jerdog/70dc5a8c3cc1e00592470654a550ff46 to your computer and use it in GitHub Desktop.

Git processes I forget

Sometimes I forget this shit... So easy to hold onto it instead of constantly googling.

Pushing to a new remote repo.md

git init
git add -A
git commit -m ""
git remote add origin git@github.com:jerdog/my-new-project.git
git push -u origin main

When the histories aren't matched on a new repo push

git pull origin main --allow-unrelated-histories

Trace commands running with git for any command

GIT_TRACE=1 git commit

Find the command causing the error, and then execute it in the command line to get the issue REF: https://gist.github.com/paolocarrasco/18ca8fe6e63490ae1be23e84a7039374

Setting up Keybase and GPG together

  1. Export PGP public key out of Keybase to GPG
keybase pgp list

If you have more than one, use the -q <keyID> switch and parameter to specify the specific key

keybase pgp export -q keyID | gpg --import
  1. Export the PGP private key out of Keybase to GPG
keybase pgp export -q keyID --secret | gpg --import --allow-secret-key-import
  1. Mark user IDs associated with the key as ultimately trusted.
gpg --edit-key <keyID>
  • at the gpg> prompt, type with the ID
uid X
  • use the trust command to set the trust level for the specified ID
  • use save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment