Difference between revisions of "Git installation"
Jump to navigation
Jump to search
Line 82: | Line 82: | ||
<source lang="text"> | <source lang="text"> | ||
Added default git ignores | Added default git ignores | ||
+ | </source> | ||
+ | |||
+ | # To see the commit message | ||
+ | git log | ||
+ | # If you would like to replace the last commit info | ||
+ | git commit --amend | ||
+ | |||
+ | == .gitattributes == | ||
+ | We want to always use [https://help.github.com/articles/dealing-with-line-endings linux line endings.] | ||
+ | Write in ".gitattributes" | ||
+ | # Declare files that will always have LF line endings on checkout. | ||
+ | #*.py text eol=lf | ||
+ | text eol=lf | ||
+ | |||
+ | git add .gitattributes | ||
+ | git commit | ||
+ | |||
+ | commit message | ||
+ | <source lang="text"> | ||
+ | Added gitattributes to have LF line endings on checkout. | ||
</source> | </source> | ||
Revision as of 13:15, 24 June 2013
Contents
Git local repository varables
This setup should provide a good framework
Git setup commit information
Write in terminal
git config --add user.name "Your Name" git config --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 --add core.editor "EditPadLite7" #Linux git config --add core.editor "nano" git config --add core.editor "gedit" git config --add core.editor "vim"
#Optional, if you want to synchronize to your github account git config --add github.user GIT_USER_NAME
relax_commit.txt
Write in "relax_commit.txt" from Format_commit_logs.
git config --add commit.template "relax_commit.txt" git add relax_commit.txt git commit
commit message
Added default relax commit message.
# To see the commit message git log # If you would like to replace the last commit info git commit --amend
.gitignore
Consider placing a file .gitignore in the root of the repository.
It could contain this information
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
*.py.swp
# 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
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store*
ehthumbs.db
Thumbs.db
*~
Check in the file
git add .gitignore git commit
commit message
Added default git ignores
# To see the commit message git log # If you would like to replace the last commit info git commit --amend
.gitattributes
We want to always use linux line endings. Write in ".gitattributes"
# Declare files that will always have LF line endings on checkout. #*.py text eol=lf text eol=lf
git add .gitattributes git commit
commit message
Added gitattributes to have LF line endings on checkout.
# To see the commit message git log # If you would like to replace the last commit info git commit --amend