{"id":8196,"library":"git-me-the-url","title":"Git Me The URL","description":"Git Me The URL is a Python library and command-line tool (CLI) designed to generate sharable links to your Git source code. It currently supports popular Git hosting platforms such as GitHub, GitLab, and Bitbucket. The project, currently at version 2.2.0, maintains an active development status with releases typically focusing on dependency updates, minor enhancements, or internal improvements, including a significant architectural rewrite in version 2.0.0.","status":"active","version":"2.2.0","language":"en","source_language":"en","source_url":"https://github.com/amykyta3/git-me-the-url","tags":["git","url","sharing","cli","version-control","github","gitlab","bitbucket","dev-tools"],"install":[{"cmd":"pip install git-me-the-url","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"The library relies on GitPython to interact with local Git repositories. GitPython, in turn, requires the 'git' executable to be installed and accessible in the system's PATH.","package":"GitPython","optional":false}],"imports":[{"note":"The primary class for generating URLs.","symbol":"GitMeTheURL","correct":"from gitmetheurl import GitMeTheURL"}],"quickstart":{"code":"import os\nfrom gitmetheurl import GitMeTheURL\n\n# Ensure you are running this code within a local Git repository\n# Or provide a specific path to a Git repository\n# For demonstration, we assume a file 'my_file.txt' exists in the current repo\n\ngmtu = GitMeTheURL()\n\n# Get a shareable URL for a specific file in the current Git repository\n# Replace 'my_file.txt' with an actual file path in your repository\n# Example: If running from the root of a repo, use 'README.md'\ntry:\n    url = gmtu.get_source_url('README.md') \n    print(f\"Shareable URL for README.md: {url}\")\nexcept Exception as e:\n    print(f\"Error generating URL: {e}\")\n    print(\"Please ensure you are in a Git repository and the file path is correct.\")","lang":"python","description":"This quickstart demonstrates how to initialize the `GitMeTheURL` object and generate a shareable URL for a file within a local Git repository. The library automatically detects the repository and its remote origin."},"warnings":[{"fix":"Review the 'Rewrote implementation of translators' section in the release notes for v2.0.0 and update any custom URL generation logic or plugins accordingly.","message":"Version 2.0.0 introduced a significant internal rewrite of the URL translator implementations. While the public API for basic usage (e.g., `get_source_url`) might remain largely compatible, any custom URL generators or plugins developed against the older internal structure may break and require updates.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Upgrade to `git-me-the-url` version 2.1.0 or higher, which explicitly removed the `pkg_resources` dependency. Ensure your `setuptools` version is compatible if you cannot upgrade the library.","message":"Versions prior to 2.1.0 had a dependency on `pkg_resources`. This package is deprecated and has been removed in Python 3.12, which could lead to `UserWarning: pkg_resources is deprecated` messages or import errors in environments with newer Python versions or `setuptools` versions (e.g., setuptools 82+).","severity":"deprecated","affected_versions":"<2.1.0"},{"fix":"Install Git on your operating system and ensure it's added to your system's PATH environment variable. Verify installation with `git --version` in your terminal.","message":"The library depends on the `git` executable being installed on the system and discoverable in the system's PATH. Without a functional `git` installation, `git-me-the-url` will not be able to interact with repositories, potentially leading to errors originating from its `GitPython` dependency.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed: `pip install git-me-the-url`. Check that the import is `from gitmetheurl import GitMeTheURL`.","cause":"The `git-me-the-url` package is not installed, or the import statement is incorrect.","error":"ModuleNotFoundError: No module named 'gitmetheurl'"},{"fix":"Navigate to the root of your Git repository before running the command, or ensure that the path passed to `get_source_url` is within a valid Git repository.","cause":"The command or Python script is being executed in a directory that is not part of a Git repository, or the specified path is not a Git repository.","error":"git.exc.InvalidGitRepositoryError: 'path/to/your/dir' does not seem to be a git repository"},{"fix":"Upgrade `git-me-the-url` to version 2.1.0 or newer: `pip install --upgrade git-me-the-url`. If unable to upgrade, you might need to pin an older `setuptools` version, though this is not recommended.","cause":"This warning occurs in older versions of `git-me-the-url` (prior to 2.1.0) when run with newer Python or `setuptools` versions. `pkg_resources` was removed in Python 3.12 and recent `setuptools` releases.","error":"UserWarning: pkg_resources is deprecated as an API."}]}