Skip to content

Instantly share code, notes, and snippets.

@Hamcha
Last active November 5, 2018 19:28
Show Gist options
  • Save Hamcha/961e57c3189496d9b569fd59b2c283b9 to your computer and use it in GitHub Desktop.
Save Hamcha/961e57c3189496d9b569fd59b2c283b9 to your computer and use it in GitHub Desktop.
GIT CONFIGS FOR LAZY PEOPLE (or for those who are just tired to have to look them up every @#$% time)

Using rebase correctly

Always pull with rebasing

git config --global branch.autosetuprebase always

Always merge with fast forward

Disable merge commits

git config --global merge.ff only

Merging pull requests

git checkout -b <branch>
git pull <remote> <branch>
[IF NEEDED] git rebase master
git checkout master
git merge <branch>

Setting up GPG

Set signing key and other required info

git config --global user.signingkey 0A46826A

On Windows and other platforms, consider setting the GPG executable path manually:

git config --global gpg.program /path/to/bin/gpg

Force git to sign all commits or fail

git config --global commit.gpgsign true

Force git to sign annotated tags

git config --global tag.forceSignAnnotated true

(if using GitHub) Add GPG key to your GitHub account

Go to https://github.com/settings/keys then scroll down to "Add GPG key".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment