Git fetch + merge, Git fetch + rebase, Git pull

Few days back, Amitoj asked me why doesn’t git fetch deletes the changes that are not present on remote but are present in local, when it does updates other changes. To explain it one need to understand the difference between git fetch + merge, git fetch + rebase and git pull and why we need to merge or rebase after a fetch and when? I tried searching for some good resources to explain the difference but I didn’t find anything good. So I thought of writing one.

First of all have a look at this image by  Oliver Steele.

XwVzT.png

Continue reading

Advertisements

./configure script arguments

At time it takes a while to figure out the configure options like below

./configure --prefix=/a/b/c --with-X --with-Y \
--with-Z-dir=/usr/local/Z --enable-A --disable-B

and after some weeks or months, if there is a need to re use it and if you have the old build somewhere in home directory.

./config.status --config

This will output the exact configure arguments that you used to configure the software.

Debugging Memory Leaks using Valgrind

Valgrind is a tool for memory debugging, memory leak detection, and profiling. It is named after the main entrance to Valhalla.

Valgrind was originally designed to be a free memory debugging tool for Linux on x86, but has since evolved to become a generic framework for creating dynamic analysis tools such as checkers and profilers.

This post is about using Valgrind to debug memory leaks.

Continue reading