Difference between revisions of "Git installation"

From relax wiki
Jump to navigation Jump to search
Line 50: Line 50:
 
# Format log "
 
# Format log "
 
relax_commit.txt
 
relax_commit.txt
 +
.gitignore
 +
 +
# From scons
 +
.sconsign.dblite
  
 
# Compiled source #
 
# Compiled source #
 
###################
 
###################
*.com
 
*.class
 
*.dll
 
*.exe
 
*.o
 
*.so
 
 
*.pyc
 
*.pyc
*.py.swp
+
*.obj
 +
*.exp
 +
*.lib
 +
*.pyd
  
 
# Packages #
 
# Packages #
Line 66: Line 67:
 
# it's better to unpack these files and commit the raw source
 
# it's better to unpack these files and commit the raw source
 
# git has its own built in compression methods
 
# git has its own built in compression methods
*.7z
 
*.dmg
 
 
*.gz
 
*.gz
*.iso
 
 
*.rar
 
*.rar
 
*.tar
 
*.tar
Line 77: Line 75:
 
######################
 
######################
 
*.log
 
*.log
*.sql
 
*.sqlite
 
  
 
# OS generated files #
 
# OS generated files #

Revision as of 14:01, 22 July 2013

Why git

See Linus Torvalds on git.

Install

Use msysgit for windows.

To install on linux, see here git-scm.com.

To build newest version, for example 1.8.x on CentOS, see here git_build.

Git user/repository variables

This setup should provide a good framework

See config list

git config --list

Git setup commit information

Write in terminal

git config --global --add user.name "Your Name"
git config --global --add user.email you@example.com

It is recommended to install EditPad Lite, and use this as an commit message editor, so you won't have line ending mis-match in windows. Just save after writing the commmit message, and exit the program. The message is committed.

#Windows
git config --global --add core.editor "EditPadLite7"
#Linux
git config --global --add core.editor "nano"
git config --global --add core.editor "gedit"
git config --global --add core.editor "vim"
#Optional, if you want to synchronize to your github account
git config --global --add github.user GIT_USER_NAME

Git aliases

For creating shorter Git aliases

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.com commit
git config --global alias.stat "status -uno"

Git local repository file settings

relax_commit.txt

Write in "relax_commit.txt", by getting template from Format_commit_logs.

git config --add commit.template "relax_commit.txt"

.gitignore

Consider placing a file .gitignore in the root of the repository.
It could contain this information

# Format log "
relax_commit.txt
.gitignore

# From scons
.sconsign.dblite

# Compiled source #
###################
*.pyc
*.obj
*.exp
*.lib
*.pyd

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.gz
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Thumbs.db
*~

See also