18 12 / 2011

Git fetch, push and merge

Lets say you created a new branch called “testbranch” on remote.

git fetch orgin

To fetch data from remote to local.

git merge origin/testbranch

To merge new “testbranch” branch.

git push origin testbranch OR git push origin testbranch:testbranch

Former is a shorthand, latter is simply saying to push local testbranch to remote testbranch.

Tags:

Permalink 12 notes

16 12 / 2011

Git Diff

git diff

Shows changes between unstaged files and last commit


git diff head

Similiar to git diff


git diff --cached

Shows changes between staged files and last commit

Tags:

Permalink 11 notes

09 11 / 2011

Installing Git in Centos5

Update:
yum install git

It works like a charm
No configurations needed. So can ignore all the below.


Basically I followed the routines as stated on this site:
http://kb.liquidweb.com/install-git-on-centos-5/

  1. yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
  2. cd /usr/local/src
    wget http://kernel.org/pub/software/scm/git/git-1.6.4.tar.gz
    tar xvzf git-1.6.4.tar.gz
    cd git-1.6.4
  3. ./configure
    make
    make install
  4. cd
    mkdir git-test
    cd git-test
    git init
Note: Instead of downloading the source file to complie and install. You might want to try yum install git first.

With a few changes. wget from googlecode instead for the latest stable version. Can get it from http://code.google.com/p/git-core/downloads/detail?name=git-1.7.7.2.tar.gz

I had to download the C complier as well. Source: http://www.cyberciti.biz/faq/howto-install-c-cpp-compiler-on-rhel/ (see option 3)
yum install gcc gcc-c++ autoconf automake

There after I can proceed with step 3 and above.

Note you might want to install Git to directory of your choice.

After installing, have to add PATH=$PATH:/path-to-git/bin-wrappers in /etc/bashrc. Last line will be fine. This gives access to all users. Could add in .bashrc of each user’s home directory for individual use.

Configure git as usual…
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email@youremail.com"


Setup it up as per normal for ssh http://help.github.com/mac-set-up-git/

You’re good to go !!

Tags:

Permalink 5 notes