-
Star
(1,392)
You must be signed in to star a gist -
Fork
(474)
You must be signed in to fork a gist
-
-
Save pksunkara/988716 to your computer and use it in GitHub Desktop.
| # vi: ft=dosini | |
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = [email protected] | |
| username = pksunkara | |
| [core] | |
| editor = nvim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| pager = delta | |
| [column] | |
| ui = auto | |
| [branch] | |
| sort = -committerdate | |
| [tag] | |
| sort = version:refname | |
| [init] | |
| defaultBranch = master | |
| [checkout] | |
| defaultRemote = origin | |
| [rerere] | |
| enabled = 1 | |
| autoupdate = 1 | |
| [diff] | |
| algorithm = histogram | |
| colorMoved = plain | |
| renames = true | |
| tool = nvimdiff | |
| [difftool] | |
| prompt = false | |
| [push] | |
| autoSetupRemote = true | |
| followTags = true | |
| [fetch] | |
| prune = true | |
| pruneTags = true | |
| all = true | |
| [rebase] | |
| autoSquash = true | |
| updateRefs = true | |
| [color] | |
| ui = auto | |
| [color "branch"] | |
| current = yellow bold | |
| local = green bold | |
| remote = cyan bold | |
| [color "diff"] | |
| meta = yellow bold | |
| frag = magenta bold | |
| old = red bold | |
| new = green bold | |
| whitespace = red reverse | |
| [color "status"] | |
| added = green bold | |
| changed = yellow bold | |
| untracked = red bold | |
| [sendemail] | |
| smtpencryption = tls | |
| smtpserver = smtp.gmail.com | |
| smtpuser = [email protected] | |
| smtppass = password | |
| smtpserverport = 587 | |
| [web] | |
| browser = google-chrome | |
| [instaweb] | |
| httpd = apache2 -f | |
| [delta] | |
| features = line-numbers decorations | |
| line-numbers = true | |
| [delta "decorations"] | |
| minus-style = red bold normal | |
| plus-style = green bold normal | |
| minus-emph-style = white bold red | |
| minus-non-emph-style = red bold normal | |
| plus-emph-style = white bold green | |
| plus-non-emph-style = green bold normal | |
| file-style = yellow bold none | |
| file-decoration-style = yellow box | |
| hunk-header-style = magenta bold | |
| hunk-header-decoration-style = magenta box | |
| minus-empty-line-marker-style = normal normal | |
| plus-empty-line-marker-style = normal normal | |
| line-numbers-right-format = "{np:^4}│ " | |
| [trim] | |
| bases = master,main | |
| protected = *production | |
| [sequence] | |
| editor = interactive-rebase-tool | |
| [filter "lfs"] | |
| clean = git-lfs clean -- %f | |
| smudge = git-lfs smudge -- %f | |
| process = git-lfs filter-process | |
| required = true | |
| [alias] | |
| a = add --all | |
| ai = add -i | |
| ############# | |
| ap = apply | |
| as = apply --stat | |
| ac = apply --check | |
| ############# | |
| ama = am --abort | |
| amr = am --resolved | |
| ams = am --skip | |
| ############# | |
| b = branch | |
| ba = branch -a | |
| bd = branch -d | |
| bdd = branch -D | |
| br = branch -r | |
| bc = rev-parse --abbrev-ref HEAD | |
| bu = !git rev-parse --abbrev-ref --symbolic-full-name "@{u}" | |
| bs = !git-branch-status | |
| ############# | |
| bl = blame -w | |
| bll = blame -w -L | |
| blm = blame -w -C -C -C | |
| blml = blame -w -C -C -C -L | |
| ############# | |
| c = commit | |
| ca = commit -a | |
| cm = commit -m | |
| cam = commit -am | |
| cem = commit --allow-empty -m | |
| cd = commit --amend | |
| cad = commit -a --amend | |
| ced = commit --allow-empty --amend | |
| ############# | |
| cl = clone | |
| cld = clone --depth 1 | |
| clg = !sh -c 'git clone https://github.com/$1' - | |
| clgp = !sh -c 'git clone [email protected]:$1' - | |
| clsp = !sh -c 'git clone [email protected]:~$1' - | |
| clgu = !sh -c 'git clone [email protected]:$(git config --get user.username)/$1' - | |
| clsu = !sh -c 'git clone [email protected]:~$(git config --get user.username)/$1' - | |
| ############# | |
| cp = cherry-pick | |
| cpa = cherry-pick --abort | |
| cpc = cherry-pick --continue | |
| ############# | |
| d = diff | |
| dc = diff --cached | |
| dk = diff --check | |
| dkc = diff --cached --check | |
| dt = difftool | |
| dtc = difftool --cached | |
| dw = diff --word-diff | |
| ############# | |
| f = fetch | |
| fo = fetch origin | |
| fu = fetch upstream | |
| ############# | |
| fp = format-patch | |
| ############# | |
| fk = fsck | |
| ############# | |
| g = grep -p | |
| ############# | |
| l = log --oneline | |
| lg = log --oneline --graph --decorate | |
| ll = log -L | |
| lf = log -S | |
| ############# | |
| ls = ls-files | |
| lsf = !git ls-files | grep -i | |
| ############# | |
| m = merge | |
| ma = merge --abort | |
| mc = merge --continue | |
| ms = merge --skip | |
| ############# | |
| o = checkout | |
| om = checkout master | |
| ob = checkout -b | |
| ############# | |
| pr = prune -v | |
| ############# | |
| ps = push | |
| psf = push --force-with-lease | |
| psu = push -u | |
| pst = push --tags | |
| ############# | |
| pso = push origin | |
| psao = push --all origin | |
| psfo = push --force-with-lease origin | |
| psuo = push -u origin | |
| ############# | |
| psom = push origin master | |
| psaom = push --all origin master | |
| psfom = push --force-with-lease origin master | |
| psuom = push -u origin master | |
| psoc = !git push origin $(git bc) | |
| psaoc = !git push --all origin $(git bc) | |
| psfoc = !git push --force-with-lease origin $(git bc) | |
| psuoc = !git push -u origin $(git bc) | |
| psdc = !git push origin :$(git bc) | |
| ############# | |
| pl = pull | |
| pb = pull --rebase | |
| ############# | |
| plo = pull origin | |
| pbo = pull --rebase origin | |
| plom = pull origin master | |
| ploc = !git pull origin $(git bc) | |
| pbom = pull --rebase origin master | |
| pboc = !git pull --rebase origin $(git bc) | |
| ############# | |
| plu = pull upstream | |
| plum = pull upstream master | |
| pluc = !git pull upstream $(git bc) | |
| pbum = pull --rebase upstream master | |
| pbuc = !git pull --rebase upstream $(git bc) | |
| ############# | |
| rb = rebase | |
| rba = rebase --abort | |
| rbc = rebase --continue | |
| rbi = rebase --interactive | |
| rbs = rebase --skip | |
| ############# | |
| re = reset | |
| rh = reset HEAD | |
| reh = reset --hard | |
| rem = reset --mixed | |
| res = reset --soft | |
| rehh = reset --hard HEAD | |
| remh = reset --mixed HEAD | |
| resh = reset --soft HEAD | |
| rehom = reset --hard origin/master | |
| ############# | |
| r = remote | |
| ra = remote add | |
| rr = remote rm | |
| rv = remote -v | |
| rn = remote rename | |
| rp = remote prune | |
| rs = remote show | |
| rao = remote add origin | |
| rau = remote add upstream | |
| rro = remote remove origin | |
| rru = remote remove upstream | |
| rso = remote show origin | |
| rsu = remote show upstream | |
| rpo = remote prune origin | |
| rpu = remote prune upstream | |
| ############# | |
| rmf = rm -f | |
| rmrf = rm -r -f | |
| ############# | |
| s = status | |
| sb = status -s -b | |
| ############# | |
| sa = stash apply | |
| sc = stash clear | |
| sd = stash drop | |
| sl = stash list | |
| sp = stash pop | |
| ss = stash save | |
| ssk = stash save -k | |
| sw = stash show | |
| st = !git stash list | wc -l 2>/dev/null | grep -oEi '[0-9][0-9]*' | |
| snap = !git stash save 'snapshot: $(date)' && git stash apply 'stash@{0}' | |
| ############# | |
| t = tag | |
| td = tag -d | |
| ############# | |
| w = show | |
| ############# | |
| wa = worktree add | |
| wl = worktree list | |
| wp = worktree prune | |
| wr = worktree remove | |
| wx = worktree repair | |
| ############# | |
| subadd = !sh -c 'git submodule add https://github.com/$1 $2/$(basename $1)' - | |
| subrm = !sh -c 'git submodule deinit -f -- $1 && rm -rf .git/modules/$1 && git rm -f $1' - | |
| subup = submodule update --init --recursive | |
| subpull = submodule foreach 'git pull --tags -f origin master || git pull --tags -f origin main || git pull --tags -f origin development' | |
| subsync = submodule sync --recursive | |
| ############# | |
| assume = update-index --assume-unchanged | |
| unassume = update-index --no-assume-unchanged | |
| assumed = !git ls -v | grep ^h | cut -c 3- | |
| unassumeall = !git assumed | xargs git unassume | |
| assumeall = !git status -s | awk {'print $2'} | xargs git assume | |
| ############# | |
| bump = !sh -c 'git commit -am \"Version bump v$1\" && git psuoc && git release $1' - | |
| release = !sh -c 'git tag v$1 && git pst' - | |
| unrelease = !sh -c 'git tag -d v$1 && git pso :v$1' - | |
| ############# | |
| behind = !git rev-list --left-only --count $(git bu)...HEAD | |
| ahead = !git rev-list --right-only --count $(git bu)...HEAD | |
| ############# | |
| merged = !sh -c 'git om && git plom && git trim' | |
| ignore = !sh -c 'echo "$1" >> .git/info/exclude' - | |
| aliases = !git config -l | grep alias | cut -c 7- | |
| bare = !sh -c 'git symbolic-ref HEAD refs/heads/$1 && git rm --cached -r . && git clean -xfd' - | |
| whois = !sh -c 'git log -i -1 --author=\"$1\" --pretty=\"format:%an <%ae>\"' - | |
| serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git | |
| ours = "!f() { git checkout --ours $@ && git add $@; }; f" | |
| theirs = "!f() { git checkout --theirs $@ && git add $@; }; f" | |
| subrepo = !sh -c 'git filter-branch --prune-empty --subdirectory-filter $1 master' - | |
| human = name-rev --name-only --refs=refs/heads/* |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Temporary files # | |
| ################### | |
| *.swp | |
| *.swo | |
| *~ | |
| # Packages # | |
| ############ | |
| *.7z | |
| *.dmg | |
| *.gz | |
| *.iso | |
| *.jar | |
| *.rar | |
| *.tar | |
| *.zip | |
| # Logs # | |
| ###################### | |
| *.log | |
| # OS generated files # | |
| ###################### | |
| .DS_Store* | |
| ehthumbs.db | |
| Icon? | |
| Thumbs.db | |
| # Editor files # | |
| ################ | |
| .vscode | |
| .zed |
Thanks for posting. I'm curious, what's the difference between the following?
[user]
username = ...
and
[github]
user = ...
I'm exploring the use of multiple GitHub accounts (without SSH) and these seem like they might be useful/related. My early GitHub and StackOverflow searches were not very helpful.
Does anyone know if you can use variables in a gitconfig include path?
I already add this command, but still I can't clone repo from outside my proxy :
git config --global http.proxy http://hendi santika:myp@[email protected]:8080
Any suggest?
Thanks
thanks!
Very useful! Thanks.
You don't have a [credential] section. Do you know how that would be used?
@hendisantika you need change your password encoding special characters:
git config --global http.proxy http://hendi santika:myp%[email protected]:8080
Is there a way to specify two different .gitignore files in the gitconfig file?
Something like this:
[remote "origin"]
.gitignore = .gitignore-origin
[remote "ac"]
.gitignore = .gitignore-ac
[credential "https://github.com"]
username = scott18
to define username for github.com only
I'm trying to find the full list of options I can use inside the .gitconfig file. Where I can find those?
Thanks, this is great!
Thanks!
Another alternative for
.gitignorefiles: https://www.gitignore.io/
Thanks. Very useful
Great!
thx!
Thanks !
Thanks a lot man....
super useful 👍
[user]
signingkey = 0A3D7C5B8C2499A8BEBCE72869D2E5C413569DA2
To sign commits with yout GPG key.
gpg --list-secret-keys and copy
To sign your commit:
git commit -S -m "signed commit"
thank you mucho
Add rebase tool, download here: https://github.com/MitMaro/git-interactive-rebase-tool
Place it in .git folder in User Profile folder.
Edit .gitconfig, if using Git Bash in Windows:
[sequence]
editor = "winpty /c/Users/{Username}/.git/interactive-rebase-tool.exe"
Very useful! Thanks. You don't have a [credential] section. Do you know how that would be used?
I found it:
[credential]
helper = cache
# same as above, but pass an argument to the helper
[credential]
helper = "cache --timeout=3600"
Important you need both stanzas for it to work.
this is nice. Thanks
Very helpful
oh, man! this saved my day!
These two specifications!
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
# name = user
# email = user@host
[user]
name = user name
email = user@host
signingkey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[github]
user = user
token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[credential]
helper = cache
# same as above, but pass an argument to the helper
[credential]
helper = "cache --timeout=3600"
I just regret that I didn't know this repo.
This is incredible, thanks a lot!
Thanks! Also, if you know, what kind of format is this? I've seen it around (e.g. .aws/config file for aws cli) but I haven't come across the name for it.
According to the documentation, there is no specific "standard" .gitconfig format. It's just a list defined by brackets and indents that Git expects to see. The closest related filetype would be a .ini file. Although similar, they still have distinct qualities that define the difference, especially in the subsections and when using values with quotations.
.gitconfig files are not difficult to edit; simply remember 1.) Sections & comments are never indented. 2.) All other lines are evenly indented (anything between 2 and 6 spaces is okay in my experience); the important point is to make them all the same width. If you prefer, use sed or awk on the Unix/Linux command line to make edits more effectively.
thanks for this!
I'm trying to find the full list of options I can use inside the
.gitconfigfile. Where I can find those?
This can be a good start: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
A very useful .gitconfig example! The alias section, in particular, has greatly improved my Git workflow. Thanks! Also, I’ve shared some useful Git tips on my website: https://codingcops.com/github-vs-gitlab/
@markediez https://en.wikipedia.org/wiki/INI_file