Skip to content

Instantly share code, notes, and snippets.

@luizcalaca
Last active November 23, 2022 22:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizcalaca/ea1642991eefd7e3c312b9e11a3ddb44 to your computer and use it in GitHub Desktop.
Save luizcalaca/ea1642991eefd7e3c312b9e11a3ddb44 to your computer and use it in GitHub Desktop.
Git configuration: alias and console formatting

Git configuration

How to configure several alias and formatting the git console

https://git-scm.com/docs/pretty-formats

Edit configuration file

git config --list
git config core.editor code (configuring to use VsCode)
git config --global --edit (After you call to edit)

Below we can create some alias:

  • git status - git s
  • git commit - git c
  • git log - git l
# This is Git's per-user configuration file.
[user]
	name = Calaça
	mail = @gmail.com
	email = @gmail.com
[core]
	editor = code --wait #wait file loading
[alias]
	s = !git status -s
	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'

[init]
	defaultBranch = main
[filter "lfs"]
	process = git-lfs filter-process
	required = true
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f

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