This repository has been archived by the owner on Dec 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Tips for working with Git and Github
Ian Wehrman edited this page Jun 15, 2015
·
1 revision
To make bower work in places where git://
URLs don't work (e.g. inside a corporate firewall), run this git command:
git config --global url."https://".insteadOf git://
To undo that after you've quit your job at a large corporate institution, run:
git config --global --unset url."https://".insteadOf
A side effect of using git over HTTPS instead of SSH (as with git://
URLS) is that, by default, you will be asked to enter your Github password before every command that requires authentication. Luckily, git can be configured to cache your credentials in memory, as described here.
Add the following to your ~/.bash_profile
:
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
DEFAULT="\[\033[0;39m\]"
CYAN="\[\033[1;36m\]"
GREEN="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
YELLOW="\[\033[1;33m\]"
MAGENTA="\[\033[1;35m\]"
GRAY="\[\033[0;37m\]"
PS1="$GREEN(\$(date +%H:%M:%S)) $GREEN\u$GREEN@$GREEN\h$DEFAULT:$CYAN\w$YELLOW\$(__git_ps1 \" (%s)\") $DEFAULT\$ ";
GIT_PS1_SHOWDIRTYSTATE=true