Tag Archives: git

[Git setup] setup git on Mac machine

Struggled for hour and get git work now ( just like old time in linux).

It used to be very easy to work with git in linux, just sudo apt-get install git … and things are done.

But it’s a little bit fuzzy with this new Mac machine.

After downloading a version of git fromĀ http://git-scm.com/download/mac

The next thing you want to try is to open terminal and type in the most lovely command “git”

But strange thing happens, it saids “bash-git command not found”

WTF, I just installed it seconds ago.

Wow, this happens because we need to tell the system what should it’s supposed to do with that command.

Your git stuffs in now in “/usr/local/git/bin/git

You need to create a symbol link to “/usr/local/bin”

Follow these steps

sudo -s
mkdir -p /usr/local/bin
ln -s /usr/local/git/bin/git /usr/local/bin/git
exit

Done !
Advertisements

[Git] How to undo pending changes on local repo.

git reset HEAD <file name | pattern of file names>