Saturday, June 18, 2011

How to setup your Git environment from scratch

SERVER SIDE
sudo apt-get install git-core git-doc gitweb git-gui gitk git-email
git-svn git-daemon-run
git init
git add .
git commit
git clone --bare ./menucook menucook.git

get the repo
git clone ssh://inguansoftsvn/home/inguanzo/depo/menucook.git

How to create a remote branch
git push origin origin:refs/heads/web

workflow to deploy into the server
git rebase origin/web

prompt for snowleopard:
parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\[\e[01;31m\]\w \$(parse_git_branch): \[\e[00m\]"

prompt for linux:
if [ "\$(type -t __git_ps1)" ]; then
    PS1="\w \$(__git_ps1 '(%s)$ ')"
fi

No comments:

Post a Comment