Skip to main content

26 posts tagged with "git"

git tag description

View All Tags

Git ours vs. git theirs

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

In Git, the terms ours and theirs are used to refer to the two conflicting versions of a file during a merge or rebase. Understanding which version is which is critical for resolving conflicts correctly [1].

Git Rebase: The Complete Guide to Rebasing, Undoing, and Advanced Workflows

11 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Rebasing is one of Git's most powerful and frequently misunderstood tools. While merging integrates changes by creating a new merge commit, rebasing rewrites history by moving your commits onto a new base. This creates a clean, linear commit history.

However, rewriting history comes with risks. This guide covers how to rebase onto main, resolve conflicts, undo mistakes, utilize advanced interactive workflows, and when to avoid rebasing entirely.

Rebasing a local branch onto a remote branch

8 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Rebasing a local branch onto a remote branch is a common workflow for keeping your feature branch up-to-date with the main development branch (like main or master) and maintaining a clean, linear commit history.

The process involves a few key steps: fetching the latest changes, checking out your local branch, performing the rebase, handling conflicts, and then force-pushing your changes if the branch was already shared.

Git Branch Operations: Checkout Files, Replace Branches, Rebase Syntax, and Deletion

9 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Sometimes, you may want to retrieve a specific file from another branch in a Git repository without switching branches completely. This is particularly useful when you want to grab a specific version of a file for debugging, rollback, or review.

In this guide, we'll walk through how to checkout a single file from another branch using Git. We'll cover multiple scenarios with examples and best practices.

How to Fix Git Pull Errors: Divergent Branches, Fast-Forward, and Unrelated Histories

7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Running git pull is usually straightforward, but when your local repository's history doesn't align with the remote server, Git stops the operation to prevent you from losing your work. This results in errors like:

  • fatal: Not possible to fast-forward, aborting.
  • Hint: You have divergent branches and need to specify how to reconcile them.
  • fatal: refusing to merge unrelated histories

Because git pull is a shortcut for running git fetch followed by git merge, you must explicitly tell Git how to reconcile these divergent histories. This guide walk you through how to fix each of these errors.