Skip to main content

26 posts tagged with "git"

git tag description

View All Tags

Enable "Last Updated" Docusaurus Dates on Vercel

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Docusaurus provides a powerful feature that displays the last updated time and last updated author for every blog post and documentation page.
However, when deploying a Docusaurus website on Vercel, many developers encounter the same confusing issue:

Every page shows the exact same “last updated” date — or no date at all.

This guide explains precisely why this happens and the exact configuration you must enable on Vercel to make Docusaurus timestamps work correctly.

Git Detected Dubious Ownership in Repository Error

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The Git error message "detected dubious ownership in repository" is a modern security feature introduced in Git version 2.35.2 (and backported to several older versions) [1].

This error occurs when you attempt to run Git commands (like git status, git pull, or git commit) inside a repository whose files are owned by a different user ID (UID) than the one currently executing the Git command.

The primary purpose is to prevent privilege escalation or arbitrary code execution when working on shared systems or filesystems that allow one user to create a malicious .git/hooks file that another user (especially one with higher privileges) might unknowingly execute [2].

Check history of specific line in vscode

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

You can check the history of a specific line in VS Code using the built-in Git Blame feature or the Timeline view. For a much more powerful experience, the free GitLens extension is highly recommended.

How to squash commits

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Squashing commits is a common Git operation that combines multiple commits into a single, cleaner commit. This is crucial for keeping your branch history tidy before merging into a main branch (like main or master), making the project history easier to read and revert [1].

The primary tool for squashing commits is interactive rebase (git rebase -i).

Git: Discard All Local Changes and Get a Fresh Copy from GitHub

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

A common and reliable way to get a fresh copy from a GitHub repository, while preserving specific local files like .gitignore, is to use a combination of git reset and git clean. This approach ensures your local branch exactly mirrors the remote branch, without leaving behind any untracked or unwanted files.

Discard all local changes and pull the latest version from a GitHub

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

To discard all your local changes and pull the latest version from a GitHub repository, you need to completely reset your local branch to match the remote's state. This process involves a few steps to ensure all uncommitted and committed local changes are removed.

This guide covers the most reliable methods, including situations where you've already made local commits.

Conventional Commits Cheat Sheet 2025

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Conventional Commits is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history, which makes it easier for automated tools to parse and for humans to understand (1).

Fix - you have divergent branches in Git

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

How to Fix "You have divergent branches" Error

The "You have divergent branches" error is a Git warning, not a hard error that stops your operation. It appears when your local branch and the corresponding remote branch have both moved forward, creating a divergent history. Git is telling you that a simple fast-forward merge is not possible and you need to choose a strategy to reconcile the differences before your next git pull.

The error message itself provides the three main solutions: merge, rebase, or fast-forward only.

Git error: 'main/' does not have a commit checked out`

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The error error: 'main/' does not have a commit checked out occurs when Git tries to add files to a submodule that is in a detached HEAD state or has no checked-out commit. This happens because the main repository expects the submodule to point to a specific commit, but it's in an invalid state.

To fix this, you need to navigate into the submodule's directory and check out a commit, usually by switching to the main branch or a specific branch.

Fix Git refusing to merge unrelated histories

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The "refusing to merge unrelated histories" error occurs when you try to merge two branches that do not share a common history. This typically happens when you initialize a new Git repository and then try to pull a remote repository's contents into it, as Git sees them as two completely separate projects.

To solve this, you can use the --allow-unrelated-histories flag. This flag forces Git to merge the two independent histories, creating a merge commit that joins them together.