Upgrading git

git

$ wget http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz
$ wget -O git-manpages-1.8.3.4.tar.gz http://code.google.com/p/git-core/downloads/detail?name=git-manpages-1.8.3.4.tar.gz&can=2&q=
Next, install all required libraries before building GIT:
$ sudo yum install zlib-devel perl-CPAN gettext
Now let’s untar and build and install GIT in the /usr directory:
$ tar xvfz git-1.8.3.4.tar.gz
$ cd git-1.8.3.4
$ ./configure
$ make
$ sudo make prefix=/usr install
$ git –version
git version 1.8.3.4

  • See more at: http://www.unixmen.com/how-to-install-latest-git-on-rhel-6-centos-6/#sthash.SAZxuE6f.dpuf

installing git on CentOS

git

to install git on CentOS, simply follow these instructions:

yum install gettext-devel openssl-devel expat-devel curl-devel zlib-devel
wget http://git-core.googlecode.com/files/git-1.8.0.tar.gz
tar xzvf git-1.8.0.tar.gz
cd git-1.8.0
make prefix=/usr/local all
make prefix=/usr/local install
[root@server1 git-1.8.0]# whereis git
git: /usr/local/bin/git

How to ignore files from git commit and push

git

Sometimes, you will want to ignore files from your git commits and pushes. For example, I had a file that stored some database information on my local machine/staging server, but the same database information doesn’t apply to my production environment.

git comes with a file called .gitignore that allows you to ignore any files during a commit or push. The .gitignore file will need to be in the top level of your working directory, and just needs to include the filename that you don’t want to use.

There is also another file located in /.git/info/exclude that you can include your files to ignore. Mac OSX has a hidden file in all directories called .DS_Store, so the below exclude file is an example that you can use:

# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store

Last night I discovered Hostgator shared servers enable…

git

Last night, I discovered Hostgator shared servers enable git services.

Then I stumbled across this page: http://toroid.org/ams/git-website-howto

This page explains exactly how to automatically update a git repo on your local machine and, with one simple git push, puts the full changes live on your webserver.

From here, this page will show you how to create a fresh repository, and how to mirror that to the server.

Using “cat > hooks/post-receive”, you can very quickly specify where your document root is on the webserver, thanks to “GIT_WORK_TREE”.

Now all of this is completed, I can simply run a “git push web” and my local version of my webpage is updated onto the server. Very nice!