Cloning a Git SVN Clone

by Thomas Aylott Tue, 22 Apr 2008 17:03:00 GMT

I’ve been trying to figure out a good way to make a publicly available git-svn repo on GitHub.com that I can clone and then keep up to date with both the original svn repo and the GitHub repo and commit everything into my own fork.

So, how do you go about creating a Git repo that can push and pull to and from both Git and Subversion?

Read more…

Posted in Git, Code, Tip, Workflow | 1 comment

Simple Install of Git on Leopard

by Thomas Aylott Thu, 21 Feb 2008 22:47:00 GMT

Here's how to install Git on Mac OS X Leopard

mkdir -p ~/Downloads/src
cd ~/Downloads/src

# Set options since we don't have GNU gettext installed
export TCL_PATH=`which tclsh`
export NO_MSGFMT=1
export GIT_VERSION='1.6.0.2'

# Get and install git
curl -O "http://kernel.org/pub/software/scm/git/git-$GIT_VERSION.tar.bz2"
tar xjvf "git-$GIT_VERSION.tar.bz2"
cd "git-$GIT_VERSION/"

# When on Mac OS X
./configure
make
sudo make install

cd ..

# Install Man Pages
curl -O "http://kernel.org/pub/software/scm/git/git-manpages-$GIT_VERSION.tar.bz2"
sudo tar xjv -C /usr/local/share/man        -f "git-manpages-$GIT_VERSION.tar.bz2"

Only needs some minor modifications to work on Dreamhost

mkdir -p "$HOME/src"
cd "$HOME/src"

# Set options even though we have GNU gettext installed
export TCL_PATH=`which tclsh`
export NO_MSGFMT=1
export GIT_VERSION='1.6.0.2'

# Get and Install Git
curl -O "http://kernel.org/pub/software/scm/git/git-$GIT_VERSION.tar.bz2"
tar xjvf "git-$GIT_VERSION.tar.bz2"
cd "git-$GIT_VERSION/"

# When on Dreamhost:
./configure --prefix="$HOME" NO_CURL=1 NO_MMAP=1
make
make install

cd ..

# Don't Bother Installing the Man Pages

After installing, you'll want to configure it

# Use Apple opendiff (FileMerge) for resolving conflicts (Mac OS X only)
git config --global merge.tool opendiff

# Ignore Carp
git config --global core.excludesfile ~/.gitignore
touch               "$HOME/.gitignore"
echo '.DS_Store' >> "$HOME/.gitignore"
echo '._*'       >> "$HOME/.gitignore"
echo '.svn'      >> "$HOME/.gitignore"
echo '.hg'       >> "$HOME/.gitignore"

# Shortcuts
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch

# Colors? YES!
git config --global color.ui auto

# Personal Setup
git config --global user.name "Your Name"
git config --global user.email your_email@your-domain.com

# Setup Bash Completion
mkdir -p "$HOME/bin"
export PATH="$HOME/bin:$PATH"
echo 'export PATH="$HOME/bin:$PATH"'               >> ~/.bash_profile
cp "$HOME/Downloads/src/git-$GIT_VERSION/contrib/completion/git-completion.bash" ~/bin
echo 'source ~/bin/git-completion.bash'            >> ~/.bash_profile

# Add the current Git Branch to your Bash Prompt
echo "PS1='[\u@\h \w\$(__git_ps1 \" (%s)\")]\\$ '" >> ~/.bash_profile


UPDATE: Now updated to 1.5.4.5
UPDATE: Now updated to 1.5.5 with Dreamhost support
UPDATE: Now updated to 1.5.6.4
UPDATE: Now updated to 1.6.0.2
UPDATE: Added bash git completions

Posted in Git, Mac OS X, Tip, Personal, Dreamhost | 7 comments