Search This Blog


Jul 15, 2014

GIT Commads Aliases

Using GIT commands Aliases are very helpful. I use them to make my your work easier with regards on GIT. In order to add aliases, simply run the following commands in GIT BASH or by adding it on the .gitconfig file.
Using GIT Bash
git config --global checkout
git config --global commit
git config --global status
git config --global branch
git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'
git config --global alias.type 'cat-file -t'
git config --global alias.dump 'cat-file -p'
Using .gitconfig
  co = checkout
  ci = commit
  st = status
  br = branch
  hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
  type = cat-file -t
  dump = cat-file -p
That's it, you can now start using those aliases. For example, instead of using git status you can use git st and so on. Happy GIT-ing!

Jul 3, 2014

Setup Virtual Host XAMPP on Linux

I always forgot on "How to set up virtual host on Linux" so I decided to create a blog post for my future reference (and for you too... you're welcome!)
I assume that you already install a XAMMP program on your system so lets jump in creating the virtual host.

1. Open your terminal and make sure you log as SU
2. Type in this command "gedit /opt/lampp/etc/httpd.conf" to open httpd.conf in the gedit editor.
3. Uncomment the "Include etc/extra/httpd-vhosts.conf" line by removing the "#".
4. Type in your terminal "gedit /opt/lampp/etc/extra/httpd-vhosts.conf" to edit httpd-vhosts.conf then add the following lines:

DocumentRoot /opt/lampp/htdocs
ServerName localhost
ServerAlias www.localhost

DocumentRoot /home/[YourCompName]/samplesite
ServerName www.samplesite.loc
ServerAlias www.samplesite.loc

IMPORTANT: Please make sure that you entered correct directory.

5. Then, edit your hosts file by typing “gedit /etc/hosts” on the terminal. Add your server alias like the following. localhost2 samplesite

6. Lastly, restart your lampp by executing "/opt/lampp/lampp restart"

Again, you're welcome!

Jun 6, 2014

[GIT] - Show Parent Commit

To understand better the merges that happens to a particular branch and to see how particular topic evolved in every single commit; just use "--first-parent" (with out quote) option in "git log" command.
git log --first-parent