-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgit-helpers.sh
executable file
·33 lines (33 loc) · 1.75 KB
/
git-helpers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# git config --global user.name OleksiyRudenko
# git config --global user.email [email protected]
cp ~/.gitignore ~/.gitignore.backup 2>/dev/null
cp ./.gitignore ~/
git config --global format.commitMessageColumns 72
git config --global core.pager cat
# git config --global push.default upstream
git config --global --add --bool push.autoSetupRemote true
git config --global merge.conflictstyle diff3
git config --global color.ui true
git config --global core.excludesfile ~/.gitignore
# aliases
git config --global alias.logg "log --graph --full-history --all --color --pretty=tformat:\"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s\""
git config --global alias.logg-lost "logg --reflog"
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.untrack 'rm --cached'
git config --global alias.unstage 'reset HEAD --'
git config --global alias.tags "tag --format='%(tag) %(subject)'"
git config --global alias.taga 'tag -f -m'
git config --global alias.tagv '!git taga "$1" "$1" && git push-tags #'
git config --global alias.tag-delete '!git tag -d "$1" && git push --delete origin "$1" #'
git config --global alias.push-tags "push --tags -f"
git config --global alias.puff "pull --ff-only"
git config --global alias.purr "pull --rebase"
# next prunes local branches, collects garbage
git config --global alias.gc-all "!git remote prune origin && git reflog expire --expire=all refs/heads/master && git fsck –unreachable && git gc"
# next lists branches you worked on (most recent goes first)
git config --global alias.branch-history "for-each-ref --sort=-committerdate --count=10 --format='%(refname:short)' refs/heads/"
# Windows specific
git config --system core.longpaths true