I had a couple of sites hosted on a Bluehost shared account and I’ve recently moved from using SVN (Subversion) to Git (I’ll try to post soon a beginner’s guide to Git), and I really wanted a fast and feasible solution for the deployment of those sites updates (really a better way than to FTP the changes, believe me).
Bluehost doesn’t support Git “out of the box”, but if you have SSH access to your account (if you don’t, just open a support ticket and ask for it. Probably you’ll need to fax or e-mail them your ID card) you can install it yourself.
1. Log into your Bluehost account via the terminal with SSH: ssh youruser@yourdomain.com (you’ll be asked for the password) and you’ll get into your home dir:
Last login: Mon NovĀ 2 08:34:58 2009 from 253.116.54.71.rev.vodafone.pt
user@domain.pt [~]#
2. Now we need to download the Git software:
user@domain.pt [~]# wget http://kernel.org/pub/software/scm/git/git-1.6.5.2.tar.bz2
This will download the Git package (compressed as tar.bz2) into the home dir of our account (please note that I’m getting the last Git version available at the time of this post but you’ll want the latest one, so make sure to check the filename first on the Git website.
3. Extract the files from the downloaded package:
user@domain.pt [~]# tar -xjvf git-1.6.5.2.tar.bz2
4. Go into the extracted directory and compile Git:
user@domain.pt [~]# cd git-1.6.5.2
user@domain.pt [~]# make
5. This will take a couple of seconds. Then you’ll be ready to install it:
user@domain.pt [~]# make install
And that’s it! You now have Git installed on your Bluehost account!
Now you can type git and hit return and you’ll get the list of the Git commands:
git
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
See 'git help COMMAND' for more information on a specific command.
user@domain.pt [~]#





