[RFC] Git standard configuration
Should we establish a default configuration for git? Everybody would be free to use it / customize it / or discard it completly but this default config would probably be useful for newcomers. Something among:
~/.gitconfig
[core]
excludesfile = ~/.gitignore
[alias]
st = status
df = diff
co = checkout
ci = commit
br = branch
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[branch]
autosetuprebase = always
~/.gitignore
.idea
.DS_Store
._*
.Spotlight-V100
.Trashes
.buildpath
.project
.settings
What do you think?
I'm against the autosetuprebase,
otherwise it's a good suggestion.
All the files we suggest should also include FULL comments on each line to describe what's done.
I have for .gitignore, surely too restritive:
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
#*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
# IDE configurations #
#####################
.idea
.settings
# Pre commit configuration
#####################
.pre-commit-config.yaml
For .gitconfig:
[color]
ui = auto
diff = auto
status = auto
branch = auto
[core]
whitespace = trailing-space,space-before-tab
[help]
autocorrect = 1
[rerere]
enabled = true
I also saw some projects with a .gitattributes,
see https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes ?
We could add :
[push]
default = current
This article is good : http://www.git-attitude.fr/2013/04/03/configuration-git/
We still miss something for the global "gitignore". Maybe we should also ship a ".gitignore-joli", which can be set in our gitconfig? If someone want to do this! :+1:
Missing a .gitattributes file which list files who should not be present when exporting a project which is really useful when packaging an application (like removing the tests, documentation, and others things which does not make sense in a production application)