Skip to main content
  1. Refs/

Git

··1 min

Snippets #

.gitconfig and credentials #

Assumes you have a self-hosted Gitlab / Github instance and want to redirect everything to SSH .gitconfig:

[user]
        email = [email protected]
        name = Rishi Maharaj
[core]
        autocrlf = input
        ignorecase = false
[init]
        templatedir = ~/.git_template
        defaultBranch = master
[url "git@gitlab-company-as-me:"]
        insteadOf = https://gitlab.company.com/
[url "ssh://[email protected]:"]
        insteadOf = https://gitlab.company.com/
[pull]
        rebase = false
[url "git@gitlab-as-me:"]
        insteadOf = https://gitlab.com/
[url "ssh://[email protected]:"]
        insteadOf = https://gitlab.com/

Store Gitlab Personal Access Token (PAT) in OSXKeychain to not have to enter password every time while on HTTPS:

echo "\
protocol=https
host=gitlab.company.com
username=your.gitlabUserName
password=xxxx" | git credential-osxkeychain store

Go To References #

Videos #