├── LICENSE ├── .bashrc ├── completions └── fish │ └── git.fish ├── configNSFW_PT-BR ├── configNSFW_HU ├── configNSFW_LT ├── configNSFW_PL ├── README.md └── config /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | # Configure colors, if available. 2 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 3 | c_reset='\[\e[0m\]' 4 | c_user='\[\033[1;33m\]' 5 | c_path='\[\e[0;33m\]' 6 | c_git_clean='\[\e[0;36m\]' 7 | c_git_dirty='\[\e[0;35m\]' 8 | else 9 | c_reset= 10 | c_user= 11 | c_path= 12 | c_git_clean= 13 | c_git_dirty= 14 | fi 15 | 16 | # Function to assemble the Git part of our prompt. 17 | git_prompt () 18 | { 19 | if ! git rev-parse --git-dir > /dev/null 2>&1; then 20 | return 0 21 | fi 22 | 23 | git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') 24 | echo " [$git_branch${c_reset}]" 25 | } 26 | 27 | # Thy holy prompt. 28 | PROMPT_COMMAND='PS1="${c_user}\u${c_reset}@${c_user}\h${c_reset}:${c_path}\w${c_reset}$(git_prompt)\$ "' 29 | 30 | # change working directory to root of repo 31 | git-root() { 32 | cd "$(git proot)" 33 | } 34 | -------------------------------------------------------------------------------- /completions/fish/git.fish: -------------------------------------------------------------------------------- 1 | #Custom Git completion for (a subset) of gitkurka/gitkurwa aliases for Fish 2 | #Put it into ~/.config/fish/completions/ (as git.fish) 3 | 4 | source $__fish_datadir/completions/git.fish 5 | 6 | complete -f -c git -n '__fish_git_using_command publishtag; and not __fish_seen_subcommand_from (__fish_git_tags)' -a '(__fish_git_tags)' 7 | complete -f -c git -n '__fish_git_using_command publishtag; and __fish_seen_subcommand_from (__fish_git_tags)' -a '(__fish_git_remotes)' -d 'Remote' 8 | complete -f -c git -n '__fish_git_using_command unpublishtag; and not __fish_seen_subcommand_from (__fish_git_tags)' -a '(__fish_git_tags)' 9 | complete -f -c git -n '__fish_git_using_command unpublishtag; and __fish_seen_subcommand_from (__fish_git_tags)' -a '(__fish_git_remotes)' -d 'Remote' 10 | 11 | complete -f -c git -n '__fish_git_using_command publish' -a '(__fish_git_remotes)' 12 | complete -f -c git -n '__fish_git_using_command unpublish' -a '(__fish_git_remotes)' 13 | 14 | 15 | -------------------------------------------------------------------------------- /configNSFW_PT-BR: -------------------------------------------------------------------------------- 1 | [color] 2 | ui = auto 3 | [color "branch"] 4 | current = yellow reverse 5 | local = yellow 6 | remote = green 7 | [color "decorate"] 8 | remoteBranch = blue bold 9 | [color "diff"] 10 | meta = yellow bold 11 | frag = magenta bold 12 | old = red bold 13 | new = green bold 14 | [color "status"] 15 | added = yellow 16 | changed = green 17 | untracked = cyan 18 | 19 | [alias] 20 | passadoporra = log --graph --date=relative \ 21 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s' 22 | mostratudoporra = log --graph --date=relative --name-status \ 23 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s%n' 24 | datanessaporra = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso 25 | 26 | quemporra = "!sh -c 'git log -i -1 --pretty=\"format::%an <%ae>\n\" --author=\"$1\"' -" 27 | oquecaraio = show -s --pretty='tformat::%h (%s, %ad)' --date=short 28 | 29 | mudancanessamerda = !sh -c 'git fetch' && git log --oneline HEAD..origin/$1 30 | cagadasnomaster = !sh -c 'git fetch' && git log --oneline HEAD..origin/master 31 | quemfoiocagao = !sh -c 'git shortlog HEAD..origin/$0' 32 | quemcagounomaster = !sh -c 'git shortlog HEAD..origin/master' 33 | 34 | tagsporra = show-ref --tags 35 | atualizatagcaraio = push --tags 36 | tagcomdatanessaporra = !sh -c 'git tag "$0"_$(date "+%y-%m-%d_%H-%M-%S")' 37 | 38 | deumerda = reset --hard 39 | 40 | quemfoiocorno = blame 41 | 42 | eagora = status 43 | oquemudounessaporra = diff 44 | meajudaplz = help 45 | salvanobutico = stash 46 | enfianobutico = stash apply 47 | limpaobutico = clean 48 | limpaedescarga = !sh -c 'git clean -x' && git reset --hard 49 | 50 | juntaporra = add 51 | salvacarai = commit 52 | mandabala = pull 53 | enfia = push 54 | enfiagostoso = push -u origin master 55 | enfiacomforca = push --force 56 | puxadinhonalaje = commit --amend -m 57 | 58 | fuidemitido = push origin --force 59 | apagatudofodase = rm .* -rF 60 | 61 | [apply] 62 | whitespace = nowarn 63 | 64 | -------------------------------------------------------------------------------- /configNSFW_HU: -------------------------------------------------------------------------------- 1 | [color] 2 | ui = auto 3 | [color "branch"] 4 | current = yellow reverse 5 | local = yellow 6 | remote = green 7 | [color "decorate"] 8 | remoteBranch = blue bold 9 | [color "diff"] 10 | meta = yellow bold 11 | frag = magenta bold 12 | old = red bold 13 | new = green bold 14 | [color "status"] 15 | added = yellow 16 | changed = green 17 | untracked = cyan 18 | 19 | [alias] 20 | kibaszottfa = log --graph --date=relative \ 21 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s' 22 | kibaszottnagyfa = log --graph --date=relative --name-status \ 23 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s%n' 24 | kurvakommitok = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso 25 | 26 | kiakurvaanyja = "!sh -c 'git log -i -1 --pretty=\"format::%an <%ae>\n\" --author=\"$1\"' -" 27 | miakurvaanyja = show -s --pretty='tformat::%h (%s, %ad)' --date=short 28 | 29 | miafaszvan = !sh -c 'git fetch' && git log --oneline HEAD..origin/$1 30 | miafaszvantekurva = !sh -c 'git fetch' && git log --oneline HEAD..origin/master 31 | kiafaszvoltez = !sh -c 'git shortlog HEAD..origin/$0' 32 | kiafaszvolteztekurva = !sh -c 'git shortlog HEAD..origin/master' 33 | 34 | kurvatagek = show-ref --tags 35 | bazdmegakurvatageket = push --tags 36 | holakurvadatum = !sh -c 'git tag "$0"_$(date "+%y-%m-%d_%H-%M-%S")' 37 | 38 | baszdkiazosszesszart = reset --hard 39 | 40 | miakurvaanyadatcsinaltal = blame 41 | 42 | kurvaanyad = status 43 | bazdmeg = status 44 | miakurvaelet = diff 45 | hogyafaszba = help 46 | nemkellidebazdmeg = stash 47 | megiskellbazdmeg = stash apply 48 | ittkurvararendlesz = clean 49 | ittkibaszottulkurvararendlesz = !sh -c 'git clean -dfx' && git reset --hard 50 | 51 | gyerunkbazdmeg = add 52 | igenbazdmeg = commit 53 | akurvaeletbe = commit --amend -m 54 | 55 | rohadjonmegmind = reset HEAD~100 56 | rohadjonmegazosszeskurvaszar = reset HEAD~100 --hard 57 | huzzalmarelakurvaanyadba = push origin --force 58 | 59 | [apply] 60 | whitespace = nowarn 61 | 62 | -------------------------------------------------------------------------------- /configNSFW_LT: -------------------------------------------------------------------------------- 1 | [color] 2 | ui = auto 3 | [color "branch"] 4 | current = yellow reverse 5 | local = yellow 6 | remote = green 7 | [color "decorate"] 8 | remoteBranch = blue bold 9 | [color "diff"] 10 | meta = yellow bold 11 | frag = magenta bold 12 | old = red bold 13 | new = green bold 14 | [color "status"] 15 | added = yellow 16 | changed = green 17 | untracked = cyan 18 | 19 | [alias] 20 | mediskurva = log --graph --date=relative \ 21 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s' 22 | medisnxkurva = log --graph --date=relative --name-status \ 23 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s%n' 24 | komitaikurva = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso 25 | 26 | kastaskurva = "!sh -c 'git log -i -1 --pretty=\"format::%an <%ae>\n\" --author=\"$1\"' -" 27 | kadakurva = show -s --pretty='tformat::%h (%s, %ad)' --date=short 28 | 29 | kayrakurva = !sh -c 'git fetch' && git log --oneline HEAD..origin/$1 30 | kayraapskritaikurva = !sh -c 'git fetch' && git log --oneline HEAD..origin/master 31 | kastenkurva = !sh -c 'git shortlog HEAD..origin/$0' 32 | kastenapskritaikurva = !sh -c 'git shortlog HEAD..origin/master' 33 | 34 | tagaikurva = show-ref --tags 35 | stumktaguskurva = push --tags 36 | taginksudatakurva = !sh -c 'git tag "$0"_$(date "+%y-%m-%d_%H-%M-%S")' 37 | 38 | amanpxkurva = reset --hard 39 | 40 | kastaskurva = blame 41 | 42 | kurva = status 43 | kaskurva = status 44 | kayrakurva = diff 45 | ekurva = help 46 | salinkurva = stash 47 | atgalkurva = stash apply 48 | pizdinkkurva = clean 49 | pizdinkvapsekurva = !sh -c 'git clean -x' && git reset --hard 50 | apsivalykkurva = !sh -c 'git branch --merged' | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d 51 | 52 | pridekkurva = add 53 | vatepvakurva = commit 54 | stumkkurva = push 55 | stumksudakurva = push -u origin master 56 | uzsipiskitkurva = push 57 | uzsipiskitkurvayolo = push --force 58 | sorrykurva = commit --amend -m 59 | 60 | kasperbybis = reset HEAD~100 61 | kasperbybisnx = reset HEAD~100 --hard 62 | otadairtavekurva = push origin --force 63 | valinkkurva = rm .* -rF 64 | 65 | ajvopsemkurva = !sh -c 'git add . && git commit -m \"palilo sie\" && git push --force && echo \"Ok, now RUN!\"' 66 | 67 | [apply] 68 | whitespace = nowarn 69 | 70 | -------------------------------------------------------------------------------- /configNSFW_PL: -------------------------------------------------------------------------------- 1 | [color] 2 | ui = auto 3 | [color "branch"] 4 | current = yellow reverse 5 | local = yellow 6 | remote = green 7 | [color "decorate"] 8 | remoteBranch = blue bold 9 | [color "diff"] 10 | meta = yellow bold 11 | frag = magenta bold 12 | old = red bold 13 | new = green bold 14 | [color "status"] 15 | added = yellow 16 | changed = green 17 | untracked = cyan 18 | 19 | [alias] 20 | drzewokurwa = log --graph --date=relative \ 21 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s' 22 | duzedrzewokurwa= log --graph --date=relative --name-status \ 23 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s%n' 24 | komitykurwa = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso 25 | 26 | ktotokurwa = "!sh -c 'git log -i -1 --pretty=\"format::%an <%ae>\n\" --author=\"$1\"' -" 27 | cotokurwa = show -s --pretty='tformat::%h (%s, %ad)' --date=short 28 | 29 | cotamkurwa = !sh -c 'git fetch' && git log --oneline HEAD..origin/$1 30 | cotammistrzukurwa = !sh -c 'git fetch' && git log --oneline HEAD..origin/master 31 | ktotamkurwa = !sh -c 'git shortlog HEAD..origin/$0' 32 | ktotammistrzukurwa = !sh -c 'git shortlog HEAD..origin/master' 33 | 34 | tagikurwa = show-ref --tags 35 | pchajtagikurwa = push --tags 36 | tagujzdatakurwa = !sh -c 'git tag "$0"_$(date "+%y-%m-%d_%H-%M-%S")' 37 | wyjebtag = !sh -c 'git tag -d "$0"' 38 | wyjebtagwchuj = !sh -c 'git tag -d "$0" && git push --delete origin tag "$0"' 39 | 40 | pojebalosiekurwa = reset --hard 41 | 42 | ktonajebalkurwa = blame 43 | 44 | kurwa = status 45 | cokurwa = status 46 | cojestkurwa = diff 47 | howcanikurwa = help 48 | nabokkurwa = stash 49 | zbokukurwa = stash apply 50 | sprzatajkurwa = clean 51 | sprzatajwszystkokurwa = !sh -c 'git clean -x' && git reset --hard 52 | wyjebzrobionekurwa = !sh -c 'git branch --merged' | grep -v "\\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d 53 | majonez = !sh -c 'branch="$(git rev-parse --abbrev-ref HEAD)" && git checkout master && git pull && git branch -d "$branch"' 54 | 55 | dodajkurwa = add 56 | takkurwa = commit 57 | sciagajkurwa = pull 58 | sciagajtegokurwa = !sh -c 'git pull origin $(git rev-parse --abbrev-ref HEAD)' 59 | dalejkurwa = push 60 | dalejnowociotokurwa = push -u origin master 61 | pchajkurwa = push 62 | pchajkurwayolo = push --force 63 | sorrykurwa = commit --amend -m 64 | spierdolwszystko = merge 65 | 66 | cofnijwchuj = reset HEAD~100 67 | wypierdolwchuj = reset HEAD~100 --hard 68 | acomitamkurwa = push origin --force 69 | walictokurwa = rm .* -rF 70 | 71 | palisiekurwa = !sh -c 'git add . && git commit -m \"palilo sie\" --no-gpg-sign --no-verify && git push --force && echo \"Ok, now RUN!\"' 72 | 73 | [apply] 74 | whitespace = nowarn 75 | 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Przydatne obecnie aliasy: 2 | 3 | ### LENIWE WERSJE STANDARDOWYCH KOMEND 4 | 5 | ###### checkout 6 | git co 7 | ###### branch 8 | git br 9 | ###### commit 10 | git ci 11 | ###### status 12 | git st 13 | 14 | ### LEPSZE WERSJE STANDARDOWYCH KOMEND 15 | 16 | ###### Pull z rebase 17 | git purr 18 | 19 | ###### Pull z fast forward only 20 | git puff 21 | 22 | ###### Diff bez plusów i minusów 23 | git difff 24 | 25 | ###### Inny sposób prezentacji wszystkich branchy 26 | git bbranch 27 | 28 | ###### Inny sposób prezentacji wszystkich branchy - jeszcze bardziej szczegółowy 29 | git branches 30 | 31 | ###### Przełącza na mastera, a jak go nie ma to na maina - dla ludzi pracujących z projektami ze zróżnicowaniem (ang. diversity) nazw głównych branchy 32 | git cmaster 33 | 34 | ###### Odkłada na bok zmiany razem z plikami nie śledzonymi 35 | git sth 36 | 37 | ###### Wyrzuca wszystko co było przygotowane do komita 38 | git unstage 39 | 40 | ###### Wyświetla wszystkie dostępne aliasy 41 | git alias 42 | 43 | ###### Inicjalizuje repo i wkomitowuje wszystkie pliki 44 | git makegitrepo 45 | 46 | 47 | ### PODSTAWOWE KOMENTY PRZEGLĄDANIA HISTORII 48 | 49 | 50 | ###### Pokazuje ładnie commity z drzewkiem i bajerami 51 | git hist 52 | 53 | ###### To co wyżej + które pliki się zmieniły i jak 54 | git histfull 55 | 56 | ###### Pokazuje commity z czasem, autorem i tagami 57 | git llog 58 | 59 | ###### Pokazuje liste komentarzy do comitów 60 | git changelog 61 | 62 | ###### Pokazuje comity bez czasu, autorem i tagami 63 | git ls 64 | 65 | ###### Pokazuje branche posortowane wg daty ostatniego commitu 66 | git recent 67 | 68 | 69 | ### PODSTAWOWE INFORMACJE O REPOZYTORIUM 70 | 71 | 72 | ###### Mówi nam trochę więcej o osobie. Pomocne zwłaszcza gdy ktoś nie skonfigurował sobie gita 73 | git whois 74 | 75 | ###### Mówi nam jaki był ostatni commit w tym czymś co podaliśmy 76 | git whatis 77 | 78 | ###### Pokazuje liczbę comitów 79 | git howmany 80 | 81 | ###### Pokazuje zestawienie commiterów i liczby ich comitów 82 | git howmanybywhom 83 | 84 | 85 | ### CO SIĘ DZIAŁO KIEDY CIEBIE NIE BYŁO... 86 | 87 | 88 | ###### Mówi jakie commity poszły do brancha od czasu gdy pullowaliśmy tego używamy żeby sprawdzić czy coś się zmieniło 89 | git anychanges 90 | 91 | ###### Jeśli branch który nas interesuje nazywa się 'master', pokazuje co się na nim zmieniło od czasu gdy pullowaliśmy. Tego używamy żeby sprawdzić czy coś się zmieniło w 90% projektów SVNo-podobnych. 92 | git anychangesonmaster 93 | 94 | ###### Mówi kto ostatnio coś zmieniał (tzn. od czasu gdy pullowaliśmy) 95 | git whoischanging 96 | 97 | ###### Jeśli branch który nas interesuje nazywa się 'master', mówi kto ostatnio coś zmieniał (tzn. od czasu gdy pullowaliśmy) 98 | git whoischangingmaster 99 | 100 | ###### Mówi jakie branche mamy w origin, kto je modyfikował i kiedy. Bardzo przydatne przy używaniu gitflow i feature branchach, żeby się zorientować, co się dzieje w projekcie (i kto/kiedy robił). Wymaga aktualnej wizji repo lokalnie (czyli git fetch origin wcześniej) 101 | git showorigin 102 | 103 | ###### Pobiera wszystkie zdalne brancze 104 | git trackallbranches 105 | 106 | ###### Pull na wszystkich branczach 107 | git updateallbranches 108 | 109 | 110 | ### TAGI 111 | 112 | 113 | ###### Wyświetla tagi z hashami 114 | git showtags 115 | 116 | ###### Domyślnie tagi nie wędrują na serwer zdalny przy pushu. Trzeba je popchnąć 'specjalnie'. Np. tą komendą (nie żeby oryginał był dłuższy). 117 | git pushtags 118 | 119 | ###### Tworzy taga z datą/godziną i przedrostkiem, np: PRZEDROSTEK_12-01-12_15-25-25 120 | git tagwithdate 121 | 122 | ###### Pokazuje ostatni tag 123 | git lasttag 124 | 125 | ###### Checkout do stanu z ostatniego taga 126 | git checkoutlasttag 127 | 128 | ###### Puszuje podany tag do repozytorium 'origin' albo do podanego jako parametr 129 | git publishtag 130 | 131 | ###### Kasuje podany tag z repozytorium 'origin' albo podanego jako parametr 132 | git unpublishtag 133 | 134 | 135 | ### IGNOROWANIE 136 | 137 | 138 | ###### Usuwa z repozytorium nowo ignorowane pliki, po modyfikacji .gitignore. Comituje od razu tę zmianę. 139 | git fixgitignore 140 | 141 | ###### Ukrywa zmiany, tak że git status ich nie widzi 142 | git hide 143 | 144 | ###### Przywraca wzrok poleceniu git status 145 | git unhide 146 | 147 | 148 | ### INNE 149 | 150 | 151 | ###### Znajduje plik w repozytorium. Wyświetla ścieżkę od roota repozytorium 152 | git find 153 | 154 | ###### Kasuje wszystkie brancze które były zmerdzowane do mastera. Wszystkie pozostałe zostawia w spokoju, o ile nie odpalasz tego na OSX ! 155 | #on osx xargs does not have -r argument, so it fail 156 | #If you remove -r, it will run at least once, making this not safe operation 157 | git cleanup 158 | 159 | ###### Kasuje wszystkie zdalne brancze które zostały osierocone (skasowane na repozytorium zdalnym). Dodatkowo kasuje wszystkie nieśledzone pliki i odpala odśmiecarke. 160 | git cleanuplocal 161 | 162 | ###### Sprawdza czy w repozytorium są jakieś pliki z "błędami białych spacji" (http://peter.eisentraut.org/blog/2014/11/04/checking-whitespace-with-git/) 163 | git check-whitespace 164 | 165 | ###### Sprawdza czy w repozytorium są jakieś pliki z windowsowymi końcami lini (CRLF) 166 | git check-eol 167 | 168 | ###### Wyświetla tickety Jirry z komentarzy 169 | git issues 170 | 171 | ###### Wyświetla aktualną nazwę brancza 172 | git branch-name 173 | 174 | ###### Puszuje bieżącego brancza do repozytorium 'origin' albo do podanego jako parametr. Ustawia upstream dla tego brancza 175 | git publish 176 | 177 | ###### Kasuje bieżącego brancza z repozytorium 'origin' albo z podanego jako parametr 178 | git unpublish 179 | 180 | ###### Pobiera z GitHuba pul request po numerze 181 | # Fetch PR from GitHub by number/id 182 | git fetchpr 183 | 184 | ###### Dodaj wszystko, skomituj z messagem, wpushuj 185 | git apm "message" 186 | 187 | ###### Zmiana aktywnego katalogu na główny katalog repozytorium (komenda basha) 188 | git-root 189 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | [branch] 2 | autosetupmerge = true 3 | 4 | [push] 5 | default = upstream 6 | [rerere] 7 | enabled = true 8 | [rebase] 9 | autosquash = true 10 | 11 | [color] 12 | ui = auto 13 | [color "branch"] 14 | current = yellow reverse 15 | local = yellow 16 | remote = green 17 | [color "decorate"] 18 | remoteBranch = blue bold 19 | [color "diff"] 20 | meta = yellow bold 21 | frag = magenta bold 22 | old = red bold 23 | new = green bold 24 | [color "status"] 25 | added = yellow 26 | changed = green 27 | untracked = cyan 28 | 29 | [alias] 30 | #LAZY VERSIONS OF BASIC COMMANDS 31 | 32 | co = checkout 33 | br = branch 34 | ci = commit 35 | st = status 36 | 37 | #BETTER VERSIONS OF BASIC COMMANDS 38 | 39 | purr = pull --rebase 40 | puff = pull --ff-only 41 | difff = diff --color-words #just words 42 | bbranch = branch -v 43 | branches = branch -avvl 44 | cmaster = "!sh -c 'git show-ref --quiet refs/heads/master && git checkout master || git checkout main'" 45 | sth = stash -u 46 | unstage = reset HEAD -- 47 | alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1 => \\2/' | grep -v 'alias'| awk 'BEGIN { FS = \"=>\" }{ printf(\"%-20s=>%s\\n\", $1,$2)}'|sort 48 | makegitrepo = !git init && git add . && git commit -m \"initial commit\" 49 | fpush = push --force-with-lease 50 | 51 | #BASIC HISTORY VIEWING 52 | 53 | hist = log --graph --date=relative \ 54 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s' 55 | histfull = log --graph --date=relative --name-status \ 56 | --format=format:'%C(auto)%h %C(bold blue)%an%C(auto)%d %C(green)%ad%C(reset)%n%w(80,8,8)%s%n' 57 | llog = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso 58 | changelog = log --pretty=format:'%Cgreen%d %Creset%s' --date=iso 59 | ls = log --pretty=format:'%C(yellow)%p..%h %C(white dim)%cd %<|(49,trunc)%an %C(reset)%s' --date=short --abbrev=8 --no-merges 60 | recent = for-each-ref --sort=-committerdate refs/heads/ --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))' 61 | 62 | #BASIC REPO INFORMATION 63 | 64 | whois = "!sh -c 'git log -i -1 --pretty=\"format::%an <%ae>\n\" --author=\"$1\"' -" 65 | whatis = show -s --pretty='tformat::%h (%s, %ad)' --date=short 66 | howmany = "!sh -c 'git log -a --pretty=oneline | wc -l'" 67 | howmanybywhom = shortlog -sn 68 | 69 | #WHAT WAS GOING ON, WHILE YOU WERE AWAY 70 | 71 | anychanges = !sh -c 'git fetch' && git log --oneline HEAD..origin/$1 72 | anychangesonmaster = !sh -c 'git fetch' && git log --oneline HEAD..origin/master 73 | whoischanging = !sh -c 'git shortlog HEAD..origin/$0' 74 | whoischangingmaster = !sh -c 'git shortlog HEAD..origin/master' 75 | 76 | #what branches you have on origin, with info on who is guilty and how long ago. Useful for gitflow and feature branches in general. Requires fetch up-front. 77 | showorigin = "!sh -c 'for branch in `git branch -r | grep -v HEAD`;do echo `git show -s --format=\"%Cred%ci %C(green)%h %C(yellow)%cr %C(magenta)%an %C(blue)\" $branch | head -n 1` \\\t$branch; done | sort -r'" 78 | 79 | #get remote branches 80 | trackallbranches = !sh -c "for branchname in `git branch -r `; do git branch --track $branchname; done" 81 | updateallbranches = !sh -c "for branchname in `git branch -r `; do git checkout $branchname ; git pull; done" 82 | 83 | #TAGS 84 | 85 | showtags = show-ref --tags 86 | pushtags = push --tags 87 | tagwithdate = !sh -c 'git tag "$0"_$(date "+%y-%m-%d_%H-%M-%S")' 88 | lasttag = describe --abbrev=0 --tags 89 | checkoutlasttag = !sh -c 'git checkout `git describe --abbrev=0 --tags`' 90 | # Pushes given tag to remote 'origin' repo (or the remote passed as the second parameter) 91 | publishtag = "!sh -c 'git push ${2:-origin} $1' -" 92 | # Removes given tag from remote 'origin' repo (or the remote passed as the second parameter) 93 | unpublishtag = "!sh -c 'git push ${2:-origin} :refs/tags/$1' -" 94 | 95 | #IGNORING 96 | 97 | # fix .gitignore 98 | fixgitignore = !git rm -r --cached . && git add . && git commit -m \"Just a .gitignore fix \" 99 | 100 | # Ignore files only locally 101 | hide = update-index --assume-unchanged 102 | unhide = update-index --no-assume-unchanged 103 | 104 | #OTHER 105 | 106 | #Finds a filename in the git repository. Gives absolute location (from the git root). 107 | find = !sh -c 'git ls-tree -r --name-only HEAD | grep --color $1' - 108 | 109 | #Deletes all branches that were safely merged into the master. All other are skipped (no worries). 110 | #on osx xargs does not have -r argument, so it fail. If you remove -r, it will run at least once, making this not safe operation 111 | cleanup = !git branch --merged=master | grep -Ev '^\\* | master$' | xargs -r git branch -d 112 | 113 | #Deletes orphaned remote branches (.git/refs/remotes/origin), clean up reflog and remove all untracked files 114 | cleanuplocal = !git remote prune origin && git gc && git clean -df 115 | 116 | # Check if any file in repo has whitespace errors 117 | # As described in http://peter.eisentraut.org/blog/2014/11/04/checking-whitespace-with-git/ 118 | check-whitespace = !git diff-tree --check $(git hash-object -t tree /dev/null) HEAD 119 | 120 | # Check if any file in repo has windows line endings 121 | #Currently do not work as alias, works from comand line directly. There is a problem with \r 122 | check-eol = !git grep --files-with-matches $'\\r' HEAD 123 | 124 | #Jira tickets (from: http://blogs.atlassian.com/2014/08/whats-new-git-2-1/) 125 | issues = "!f() { : git log ; echo 'Printing issue keys'; git log --oneline $@ | egrep -o [A-Z]+-[0-9]+ | sort | uniq; }; f" 126 | #version for git below 2.1 127 | #issues = !sh -c 'git log --oneline $@ | egrep -o [A-Z]+-[0-9]+ | sort | uniq' - 128 | 129 | # Gets the current branch name (not so useful in itself, but used in other aliases) 130 | branch-name = "!git rev-parse --abbrev-ref HEAD" 131 | # Pushes the current branch to the remote "origin" (or the remote passed as the parameter) and set it to track the upstream branch 132 | publish = "!sh -c 'git push -u ${1:-origin} $(git branch-name)' -" 133 | # Deletes the remote version of the current branch from the remote "origin" (or the remote passed as the parameter) 134 | unpublish = "!sh -c 'set -e; git push ${1:-origin} :$(git branch-name);git branch --unset-upstream $(git branch-name)' -" 135 | 136 | # Fetch PR from GitHub by number/id 137 | fetchpr = "!sh -c 'git fetch origin pull/$0/head:pr/$0'" 138 | 139 | #add all, commit with message and push to remote 140 | apm = "!f() { git add --all && git commit -m \"$@\" && git push; }; f" 141 | 142 | [apply] 143 | whitespace = nowarn 144 | [core] 145 | pager = less -R 146 | [help] 147 | autocorrect = 1 #fucking magic! 148 | 149 | #Kudos for (copied from): 150 | #http://git-scm.com/book/en/Customizing-Git-Git-Configuration 151 | #http://robots.thoughtbot.com/post/4747482956/streamline-your-git-workflow-with-aliases 152 | #http://oli.jp/2012/git-powerup/#conclusion 153 | #http://blog.blindgaenger.net/advanced_git_aliases.html 154 | #https://gist.github.com/robmiller/6018582 (branch-name, publish, unpublish) 155 | --------------------------------------------------------------------------------