Setting up & Operating GIT repositories

Client Setup

identify yourself,

#git config --global --edit
git config user.name
git config user.name "your name or user@hostname"
git config user.email
git config user.email "your@email"

some defaults,

#git config --global push.default simple
#git config --global core.editor elvis

Dirty Tweaks

for docs, scripts & configs you do not want to track like hell, those are some handy GIT aliases,

git config --global alias.nc 'commit -a --allow-empty-message -m ""'
git config --global alias.ci 'commit --allow-empty-message -m ""'

to push the devil even harder, one might use those Shell aliases,

alias push='git nc && git push'
alias stat='git diff --stat --cached origin/master'

Fetching a repository

Github,

git clone git@github.com:ACCOUNT/REPO.git
#git clone https://github.com/pbraun9/slackbuilds.git

Gitlab on-premises,

git clone ssh://git@gitsrv/home/git/project.git
#git clone http://git@gitsrv/home/git/project.git
#git clone https://git@gitsrv/home/git/project.git

Using GIT in production

update the list of branches, switch to the new revision,

    git fetch -a
    git checkout release-1.1.0
    git pull

and restart the application.

Troubleshooting

no certificates

I am being lazy here – for testing and internal purposes on possibly embedded systems that are missing certs, when you do not want to play with PKI but actually play with something else,

git config --global http.sslVerify false

Enabling RAW control chars

If you got shit like this when doing git diff,

ESC[32m+ESC[mESC[32m#

==> enable “raw” control characters in your PAGER,

git config --global core.pager "less -r"