Skip to content

Instantly share code, notes, and snippets.

@nfreear
Last active May 1, 2020 05:27
Show Gist options
  • Save nfreear/2895616 to your computer and use it in GitHub Desktop.
Save nfreear/2895616 to your computer and use it in GitHub Desktop.
Per-user ~/.gitconfig and per-REPO/.git/config on OU servers (hence smart HTTPS protocol) — plus .npmrc
# See: http://draconianoverlord.com/2010/03/04/git-config.html
# See: https://github.com/rtomayko/git-sh
# See: https://gist.github.com/502434
# REPO/.git/config
[remote "origin"]
# Generic by default.
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://[email protected]/IET-OU/pd-open-ac-uk.git
[remote "nick"]
# Pull as another user on the local server.
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://[email protected]/IET-OU/pd-open-ac-uk.git
[remote "nick2"]
# Push to a second repository..
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://[email protected]/nfreear/PROJECT.git
[remote "all"]
# Push to 'all'.
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:IET-OU/project.git
url = [email protected]:project.git
# USER ~/.gitconfig
# $ git config --global http.proxy http://wwwcache.open.ac.uk:80
[http]
proxy = http://wwwcache.open.ac.uk:80
[https]
proxy = http://wwwcache.open.ac.uk:80
[user]
# Generic by default.
name = IET-OU
email = iet-webmaster+@+open.ac.uk
[core]
# http://stackoverflow.com/questions/1889559/git-diff-to-ignore-m
whitespace = cr-at-eol
#autocr--lf = true
# http://stackoverflow.com/questions/2517190/how-do-i-force-git-to-use-lf-instead-of-crlf-under-windows
autocrlf = input
# https://help.github.com/articles/ignoring-files/
excludesfile = ~/.gitignore_global
[alias]
# http://githowto.com/aliases
co = checkout
ci = commit
st = status
br = branch
# Pull as [email protected] - branch is required.
pn = !git pull nick master
cn = !git commit --author="Nick Freear <..>"
# Force message-editing on commit
cm = !git commit -em
# iSpot-specific
mydiff = !git diff -- $(git diff --name-only | grep -Ev "app.css")
ol = log --oneline
# http://stackoverflow.com/questions/5772192/git-how-can-i-reconcile-detached-head-with-master-origin
hash = log --format='%h'
#olg = log --graph --decorate --pretty=oneline --abbrev-commit
#olg = log --format=\"%C(green)%h%Creset%<(24,trunc)%d~ %<(48,trunc)%s%Cgreen %cd\" --graph --date=short
olg = log --format=\"%C(green)%h%Creset %<(72,trunc)%s%C(green)%cd\" --graph --date=short
assumed = !git ls-files -v | grep ^H | cut -c 3- ;
[color]
# turn on color
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
# http://stackoverflow.com/questions/1722807/git-convert-git-urls-to-http-urls
[url "http://github.com/"]
insteadOf = "[email protected]:"
[url "https://<USERNAME>@github.com/"]
insteadOf = "[email protected]:"
# Fix npm/apm install (proxy) error
# https://github.com/npm/npm/issues/5257
# https://github.com/atom/apm/issues/106
[url "https://"]
insteadOf = git://
# USER ~/.bashrc
# $ vi ~/.bashrc
# $ source ~/.bashrc
# http://kartzontech.blogspot.co.uk/2011/04/how-to-disable-gnome-ssh-askpass.html
unset SSH_ASKPASS
export http_proxy=wwwcache.open.ac.uk:80
export HTTPS_PROXY=wwwcache.open.ac.uk:80
export no_proxy="localhost,127.0.0.1,.open.ac.uk,.open.edu"
#End.
---
# https://jjasonclark.com/how-to-setup-node-behind-web-proxy/
# [root@pegasos nquire-web-source]# npm config set proxy http://wwwcache.open.ac.uk:80
# [root@pegasos nquire-web-source]# npm config set https-proxy http://wwwcache.open.ac.uk:80
[root@pegasos nquire-web-source]# more ~/.npmrc
proxy=http://wwwcache.open.ac.uk:80/
https-proxy=http://wwwcache.open.ac.uk:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment