@blorgfester
Git is powerful and very fast
Our primary function is programming
A little bit of git knowledge pays dividends
"git is harder to learn than the programming" - Someone on twitter
"It just disappears into git and then who knows where it goes?" - A colleague
[alias]
st = status
ru = remote update --prune
cm = commit -m
co = checkout
au = add -u
aa = add -A
ai = add -i
cu = clean -d -fx
pr = pull --rebase
po = push origin master
mnff = merge --no-ff
fo = fetch origin
su = !git submodule sync && git submodule update --init --recursive
cos = "!f(){ git co "$1" && git su; };f"
In ~/.gitconfig:
Url for a copy of my .gitconfig:(https://sciphus.com/gitconfig)
git config --global core.editor notepad
git config --global core.editor "code --wait"
git log is not so readable
git log --graph --decorate --oneline --date=relative --all
tlog()
{
tortoisegitproc /command:log /path:. &
}
exp()
{
explorer . &
}
In ~/.bashrc
git bisect to the rescue
git rebase --interactive
Â
Create a bare repository in ~/deployment
A add the post-receive hook:
#!/bin/bash
echo "Changes received - Deploying to production..."
git --work-tree=/var/www/html --git-dir=/home/deployment checkout -f
On your machine, add the remote:
git remote add production <you>@<yourwebhost>:~/deployment
Resetting to the previous commit:
git reset --hard master@{1}
git reset --hard @{1}
git config --global alias.undo '!f() { git reset --hard @{1}; }; f'
git config --global alias.undo '!f() { git reset --hard @{${1-1}}; }; f'
@blorgfester