Skip to main content

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

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

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.

Save username and password in Git

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

To save your username and password in Git, you can configure a credential helper. A credential helper is a Git component that securely stores your authentication information in memory or on disk, so you don't have to enter it every time you interact with a remote repository.

Fix 'Write access to repository not granted' in Git/GitHub

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

The fatal: unable to access error with the message "Write access to repository not granted" typically means you don't have the necessary permissions to push changes to the GitHub repository. It's a clear signal from the server that your authentication credentials, while valid, don't grant you the required write access.

Here's how to diagnose and solve this issue:

Create image sitemap file for Docusaurus

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

Docusaurus doesn't have a built-in feature to create a separate image sitemap. The @docusaurus/plugin-sitemap only handles generating a sitemap for your pages and documentation, not for media like images.

Since the plugin doesn't have a specific option for image sitemaps, the recommended approach is to manually create an XML file that follows the image sitemap protocol and place it in the static directory of your Docusaurus project.

Fixing Vercel Python Import Errors: Causes, Solutions, and Helper Functions

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

The primary cause for import errors on Vercel is often a mismatch between your local development environment's flexibility and Vercel's strict, serverless build process. Beyond the crucial __init__.py file, you need to pay attention to your project's overall structure, the way you write imports, and Vercel's build configuration.

Whats the point of __init__.py on Vercel

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

The imports working perfectly fine locally, but failed after deploying on Vercel. The error I've experiencing is common when deploying Python applications with a specific file structure. My local environment likely handles imports differently than Vercel's serverless environment(because of the folder structure), which can cause import errors. The solution is to ensure that my project structure is recognized as a Python package

Switching Python Versions: Complete Developer Guide to pyenv, Poetry, CLI Cheatsheet, and Troubleshooting

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

Managing active Python interpreters is a fundamental workflow requirement, particularly when developing across multiple backend microservices with competing runtime constraints or legacy dependencies. Directly altering system Python binaries breaks core OS utilities.

This guide provides a comprehensive manual on how to switch Python versions safely, featuring pyenv (installation, precedence mechanics, CLI cheatsheet, and troubleshooting), Poetry (project-level virtual environments), operating system overrides (Linux, macOS, Windows), and containerized Docker environments.

Cloning a list in Python

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

Cloning a list in Python is essential to avoid unintended side effects, as simply assigning one list to another with the equals sign (=) creates a reference, not a new copy [1]. This means both variables point to the same list object in memory, and modifying one will modify the other. To properly clone a list, you need to understand the difference between a shallow copy and a deep copy.

Choosing the right Python environment and package management tool in 2025

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

Choosing the right Python environment and package management tool in 2025 depends on your project's complexity and your team's workflow. The tools available can be categorized into two main groups: those that manage Python versions (pyenv, asdf) and those that manage project dependencies (venv, virtualenv, Poetry). Combining these tools is often the most effective approach.

Looking for more content?
Hrekov Blog contains 165 articles. Browse the blog archive or Explore the full timeline.