Turn on coloring in git. It is an easy one line command:
git config --global --add color.ui true
This is probably more useful to a developer that is doing lots of git commands. Autocompletion also autocompletes on branch names, making it easier to switch branches.
If you have Homebrew installed, then I have used the bash_completion route to get this capability:
http://blog.jeffterrace.com/2012/09/bash-completion-for-mac-os-x.html
Looks like there is also this pathway, but have not tried it:
http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/
If on Linux you may already have this capability built in.
For showing the current git branch on the command line, and showing the command line in color, open your ~/.profile file and comment out (using a #) any existing PS1
line and paste the following below that commented out line:
(this is for the standard default bash shell on OS X)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local END="\[\033[0m\]"
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
$BLUE[$RED\w$GREEN\$(parse_git_branch)$BLUE]\
$END$ "
PS2='> '
PS4='+ '
}
proml
Next shell you open should have the colors.
Below are two scripts, gaia-pull and gaia-clean-pull. They both assume you already have your own fork of gaia set up and you have pull it down and have set the mozilla-b2g/gaia as the upstream repo:
git remote add upstream https://github.com/mozilla-b2g/gaia.git
Once you have your fork cloned locally you can place gaia-pull and gaia-clean-pull in your PATH and use them to try out pull requests. General process:
- You get a link to a pull request, in the form of
https://github.com/mozilla-b2g/gaia/pull/123456
. The last number on there is the pull request number. Copy that (in this example, 123456), and then inside thegaia
directory, type: gaia-pull 123456
- The gaia repo is ready to go. Type
make GAIA_OPTIMIZE=1 reset-gaia
to install on the device. - You can use
git diff
in the gaia directory to see what files have changed. - Once you are done, clean up the temporary branch by doing:
gaia-clean-pull 123456
At the end of that, you should be back on the master branch in your fork.
If you comment on this Gist, I will not see it, because GitHub does not notify me of Gist comments, so be sure to ping me in IRC or online if you do leave a comment.