Archive for the 'git' Category

Enhance Git Log

The output of git log command is the most frustrating thing you face on git shell usage. But in one minute a poor git log output like

is enhanced to

It is done in the following way:

Read more »


Waste your time due to accident git checkout? Prevent it now!

A common thing by using git in unix shell is accident executing git checkout -f command. For example, you want to reset some file by getting it from the head with git checkout -f filename, but instead of this you drop the changes on the whole branch by accidentally executing git checkout -f.

You can easily protect yourself by saving changes on the development branch into a tiny patch file before any git checkout command:

Read more »


Fix and get better fonts for gitk running on Ubuntu

You can make Gitk fonts look better! Gitk fonts are handled by the simple windowing shell (wish), it should be configured and the different graphical toolkit should be installed:

# Getting different graphical toolkit (tk8.5)
sudo apt-get install tk8.5
# Switching toolkit. Choose the /usr/bin/wish8.5 item
sudo update-alternatives --config wish

Enjoy gitk with the better front now!

You can always rollback these changes by performing the last step once again and choosing the first selection item.


Global .gitignore

To get git to ignore certain files and directories without having to put .gitignore file in every git repsitory, you need once to create a global ~/.gitignore file and configure it as a global .gitignore:

# Copy .gitignore to your home directory or create a new one with touch:
touch ~/.gitignore

# Make it global:
git config --global core.excludesfile ~/.gitignore

Example of ~/.gitignore file:

[email protected]:~$ cat ~/.gitignore