I found this great article on Intridea Development Blog on how to put git status in your prompt window. It’s an amazingly useful addon as I often forget what branch I’m on in my project or if I changed anything. The problem is that it’s written for OSX/Linux users. So I’d like to show you what you need to do to get this same functionality in Git Bash on Windows. (Git Bash using MSysGit)
To make this addon work with Git Bash you need to create your BASH settings file. To do this go to your home directory and create a file called ‘.bashrc’
Because Windows Explorer will not let you create a file without a name (only an extension) we need to use Git Bash (or command prompt): Open Git Bash (by default it will be in the home directory) and type in “touch .bashrc”
Inside your .bashrc file type this: (copied from Intridea Development Blog):
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* (.*)/[1$(parse_git_dirty)]/"
}
export PS1='u:[ 33[0;32m]w[ 33[0;33m]$(parse_git_branch)[e[0m]: '
Now open a new Git Bash window and you should see your new prompt. Keep in mind it will not show up in folders that aren’t git repositories and it will slow down your prompt a bit because it has to check the status of your Git repository every time you hit ENTER.
Update: It seems the new version of msysGit comes with this feature built in
Learn MoreInternet Explorer 8 being release soon and Microsoft putting in the work to make IE8 pass the Acid 2 test, SitePoint decided to write about the new way to do visual layout using CSS tables that are both easy or reliable across the the major browsers. The name of the book is Everything You Know About CSS Is Wrong by Rachel Andrew and Kevin Yank, published by SitePoint and available now.
The Book
The book comes in at 111 pages long and is as beautiful as The Principles of Beautiful Web Design which is very stunning (visually). Now I own a few books from SitePoint and find that their CSS code is very clean and very well written but was slightly disappointed with this book. I bought this book without reading other reviews, I only watched the video on YouTube published by SitePoint about the book and as dry as this video is it got me interested enough to get the book.
I was able to read the book in just two sittings. The book is very simple and is aimed for both novice and experts.
My Issues
My issue with the book is that if you’re new to CSS, you don’t know anything, therefore your knowledge can’t be wrong (playing off the title). I believe there is just a bit too much hand holding. I read Build Your Own Ruby on Rails Web Applications and thought that even though the book isn’t design to cover CSS, it had one of the best and cleanest CSS in any book I have ever read (which isn’t a whole lot). While the CSS in this book was not as clean as I was hoping.
One of the biggest disappointments of this book is that it covers only one subject, which is table layout using CSS. Even though they managed to stretch it out over 111 pages, it really could have been written in much much less. It really feels like a missing chapter from The Art & Science Of CSS.
Conclusion
All in all, I think that table layout in CSS is the way of the future and if you want to learn it step by step than this book is for you. The book also covers how to make a layout for IE 7 (or less) which you won’t find easily online. If you want to save yourself a few dollars, I found a great post from Digital Web Magazine that pretty much summarizes the book perfectly.
Learn More