source code control|Install git using Macports
Install git using Macports
001.#002.# Git setup and configuration on Mac003.# adapted from: http://arthurkoziel.com/2008/05/02/git-configuration/004.#005. 006.# first install macports if you don't have it installed007.#008.# http://guide.macports.org/#installing.macports009. 010.# make sure your local ports tree is up-to-date011. 012.sudo port selfupdate013. 014.# find out what version of git is available015. 016.port search git-core017. 018.# list the port variants available for git019. 020.port variants git-core021. 022.# install git and add the variants git-svn and git bash completion scripts023. 024.sudo port install git-core +svn+bash_completion025. 026.# you can add "+doc+gitweb" to get the html form of the documentation027.# and the web application that will serve git028. 029.# Install bash completion:030. 031.cp /opt/local/etc/bash_completion.d/git ~/.git-bash-completion.sh032.echo "[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh" >> ~/.profile033.. ~/.profile034. 035.# If you've already installed git using ports and want to know if there036.# is a newer version of git available037. 038.sudo port selfupdate039.port outdated git-core040. 041.# Installing a newer version of git042.# The old version is de-activated but will stay installed so it is043.# easy to deactivate the newer version and activate the older version044.# if that proves necessary.045. 046.sudo update git-core +svn+bash_completion047. 048.# Git configuration049. 050.# List of configuration variables:051. 052.git config --help053. 054.# list your current global git config properties055. 056.git config --global -l057. 058.# Global ignore file:059. 060.echo ".DS_Store" >> ~/.gitignore061.git config --global core.excludesfile ~/.gitignore062. 063.# SVN-like shortcuts for often used commands:064. 065.git config --global alias.st status066.git config --global alias.ci commit067.git config --global alias.co checkout068.git config --global alias.br branch069. 070.# Information about the author/commiter:071. 072.git config --global user.name "Your Name Comes Here"073.git config --global user.email you@yourdomain.example.com074. 075.# If you want git to send patches via mail from git:076. 077.git config --global sendemail.smtpserver smtp.my-isp.com078. 079.# Colorized output:080. 081.git config --global color.branch auto082.git config --global color.diff auto083.git config --global color.interactive auto084.git config --global color.status auto085. 086.# TextMate as the default editor:087. 088.git config --global core.editor "mate -w"089. 090.# Opendiff (FileMerge) to resolve merge conflicts:091. 092.git config --global merge.tool opendiff093. 094.# Change the font in gitk:095.# Open ~/.gitk and add:096. 097.set mainfont {Monaco 12}098.set textfont {Monaco 12}099.set uifont {Monaco 12}
Posted by
Stephen Cheng
at
7:50 PM
1 comment:
Thanks for sharing this tip!
Web Hosting Services
Post a Comment