codingstyle icon indicating copy to clipboard operation
codingstyle copied to clipboard

[RFC] Git standard configuration

Open pyrech opened this issue 10 years ago • 6 comments

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?

pyrech avatar Dec 17 '15 11:12 pyrech

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.

damienalexandre avatar Dec 17 '15 11:12 damienalexandre

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

ternel avatar Dec 17 '15 11:12 ternel

I also saw some projects with a .gitattributes, see https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes ?

damienalexandre avatar Dec 21 '15 23:12 damienalexandre

We could add :

[push]
        default = current

This article is good : http://www.git-attitude.fr/2013/04/03/configuration-git/

franek avatar Dec 23 '15 09:12 franek

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:

damienalexandre avatar Dec 29 '15 18:12 damienalexandre

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)

joelwurtz avatar Sep 07 '16 15:09 joelwurtz