Skip to content

Instantly share code, notes, and snippets.

@raloliver
Created May 5, 2021 13:51
Show Gist options
  • Save raloliver/9b01ebc6aed98966b5d0905e90398714 to your computer and use it in GitHub Desktop.
Save raloliver/9b01ebc6aed98966b5d0905e90398714 to your computer and use it in GitHub Desktop.
git.config
[user]
mail = email@domain.com
name = username
email = email@domain.com
[core]
editor = code --wait
[alias]
s = !git status
c = !git add --all && git commit -m
l = !git log --pretty=format:'%C(blue)%h%C(red)%d %C(white)%s - %C(cyan)%cn, %C(green)%cr'
@MichaelCurrin
Copy link

MichaelCurrin commented May 5, 2021

And if you don't have any new untracked files, you can commit all in the current dir and below, without using add and without an alias.

$ git commit .

Or target a dir or file.

$ git commit foo.txt
$ git commit foo*.js
$ git commit tests/

@raloliver
Copy link
Author

Great tips Michael... I never do deep into git stuff, this is my first time with shortcuts on git... I only config the user stuff.

@MichaelCurrin
Copy link

Glad to help. Here are most of my aliases if you are interested. https://github.com/MichaelCurrin/dotfiles/blob/master/.gitconfig.toml

In particular, see alias, which let's me run git alias and see a list of my aliases :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment