We are your Digital Ally™
Tech talks: Git basics
education

Tech talks: Git basics

A summary of the first Instea tech talk session covering Git fundamentals: merge vs rebase, stash, git fetch, log visualization, and aliases.

Stanislav MiklikNovember 8, 2015

The Instea team established an educational program featuring hour-long sessions where employees discuss best practices and emerging technologies. This post summarizes the first session focused on Git fundamentals.

Merge vs Rebase

git pull by default merges changes, creating a non-linear history with multiple merge commits. An alternative approach using git pull --rebase replays local work over the latest codebase, maintaining a linear history.

The tradeoff: conflicts during rebase make the original commit unavailable for review.

# Default merge approach
git pull
 
# Rebase approach (linear history)
git pull --rebase

Stash

This feature allows developers to temporarily set aside uncommitted work:

# Save uncommitted changes
git stash
 
# Restore saved changes
git stash pop

Additional Tips

Use git fetch to download remote changes without affecting local work:

git fetch

For better visualization of all branches:

git log --all
gitk --all

Create custom git aliases for frequently-used commands. Example alias for enhanced log formatting with color and graph visualization:

# Add to ~/.gitconfig
[alias]
    lg = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
© 2026