It’s never to late for git.
If not already done, every software developer must try GIT - the fast, distributed version control system. It’s such a nice and useful tool. Once every week I find a new little nice feature.
The last month I used the git-client together with a svn-remote repository and I will never use the svn client again. It is so handy to have the full history of the repository on my notebook. I can commit my changes every time to my local repository and merging/branching is just fun. I’m so much faster …
Here my path to git
- Effectively Using Git With Subversion
- Dominik (a colleague which answered my first questions)
- Pragmatic Guide to Git by Travis Swicegood
- The Git Community Book
- the git man pages
- … and using it every day
Here my favorite git client in action (the command line client
:
There are plugins for eclise, idea, windows, mac… So give it a try and have fun!
And if you want to have the little nice prompt add the following lines to your .bashrc:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ... #----------------------------------- # git in prompt #----------------------------------- RED="\[\033[0;31m\]" YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" BLUE="\[\033[0;34m\]" LIGHT_RED="\[\033[1;31m\]" LIGHT_GREEN="\[\033[1;32m\]" WHITE="\[\033[1;37m\]" LIGHT_GRAY="\[\033[0;37m\]" COLOR_NONE="\[\e[0m\]" function parse_git_branch { git rev-parse --git-dir &> /dev/null git_status="$(git status 2> /dev/null)" branch_pattern="^# On branch ([^${IFS}]*)" remote_pattern="# Your branch is (.*) of" diverge_pattern="# Your branch and (.*) have diverged" if [[ ! ${git_status} =~ "working directory clean" ]]; then state="${RED}?" else state="${GREEN}?" fi # add an else if or two here if you want to get more specific if [[ ${git_status} =~ ${remote_pattern} ]]; then if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then remote="${YELLOW}?" else remote="${YELLOW}?" fi fi if [[ ${git_status} =~ ${diverge_pattern} ]]; then remote="${YELLOW}?" fi if [[ ${git_status} =~ ${branch_pattern} ]]; then branch=${BASH_REMATCH[1]} echo " (${branch})${remote}${state}" fi } function prompt_func() { previous_return_value=$?; prompt="${GREEN}${USER:-$(type whoami >/dev/null && whoami)}@$(type uname >/dev/null && uname -n) ${BLUE}[\w${GREEN}$(parse_git_branch)${BLUE}]${COLOR_NONE} " if test $previous_return_value -eq 0 then # PS1="${prompt}? " PS1="${prompt} \\$ " else #PS1="${prompt}${RED}?${COLOR_NONE}" PS1="${prompt}${RED}\\$ ${COLOR_NONE}" fi } PROMPT_COMMAND=prompt_func |
I found this script at github and changed it a little bit. Thx to trapni.
-
Articles
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- May 2011
- April 2011
- February 2011
- January 2011
- December 2010
- November 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- March 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
-
Meta






