{"id":16095492,"url":"https://github.com/miromannino/contributions-importer-for-github","last_synced_at":"2025-05-15T09:08:30.964Z","repository":{"id":40434245,"uuid":"127155010","full_name":"miromannino/Contributions-Importer-For-Github","owner":"miromannino","description":"This tool helps users to import contributions to GitHub from private git repositories, or from public repositories that are not hosted in GitHub.","archived":false,"fork":false,"pushed_at":"2025-02-26T10:38:57.000Z","size":490,"stargazers_count":367,"open_issues_count":5,"forks_count":57,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-15T09:08:19.629Z","etag":null,"topics":["bitbucket","contributions","contributions-calendar","contributions-discover","github","gitlab","import","private-repository","statistics"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miromannino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-28T14:44:15.000Z","updated_at":"2025-05-04T09:30:38.000Z","dependencies_parsed_at":"2024-10-26T19:31:19.175Z","dependency_job_id":"7ca4a4fd-3566-4aeb-aec7-231ceb3bb2d7","html_url":"https://github.com/miromannino/Contributions-Importer-For-Github","commit_stats":{"total_commits":48,"total_committers":10,"mean_commits":4.8,"dds":0.3125,"last_synced_commit":"8fbcdd30f27570c0beaf3f1ae906e6bdee326d6d"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miromannino%2FContributions-Importer-For-Github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miromannino%2FContributions-Importer-For-Github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miromannino%2FContributions-Importer-For-Github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miromannino%2FContributions-Importer-For-Github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miromannino","download_url":"https://codeload.github.com/miromannino/Contributions-Importer-For-Github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310520,"owners_count":22049470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitbucket","contributions","contributions-calendar","contributions-discover","github","gitlab","import","private-repository","statistics"],"created_at":"2024-10-09T17:05:27.357Z","updated_at":"2025-05-15T09:08:25.950Z","avatar_url":"https://github.com/miromannino.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contributions Importer for GitHub\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/miromannino/Contributions-Importer-For-Github/blob/main/LICENSE) [![pypi version](https://img.shields.io/pypi/v/git-import-contributions.svg)](https://pypi.org/project/git-import-contributions/) [![Build and Tests](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/tests.yaml/badge.svg)](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/tests.yaml) [![Static Code Analysis](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/static-analysis.yaml/badge.svg)](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/static-analysis.yaml) [![Code Security Analysis](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/security.yaml/badge.svg)](https://github.com/miromannino/Contributions-Importer-For-Github/actions/workflows/security.yaml)\n\nThis tool helps users to import contributions to GitHub from private git repositories, or from public repositories that are not hosted in GitHub.\n\n\u003cp style=\"margin: 20px\" align=\"center\"\u003e\n\u003cimg src=\"https://github.com/miromannino/contributions-importer-for-github/blob/resources/fig1.png?raw=true\" /\u003e\n\u003c/p\u003e\n\n## How it Works\n\nIn its simplest case, this tool copies all commits from a source git repository to a mock git repository. Each copied commit will report the same commit date, but the original code is not copied, nor is the commit message.\n\n\u003cp style=\"margin: 20px\" align=\"center\"\u003e\n\u003cimg src=\"https://github.com/miromannino/contributions-importer-for-github/blob/resources/fig0.png?raw=true\" /\u003e\n\u003c/p\u003e\n\n_Contributions Importer_ will create instead mock code to report which languages have been used in the source repository.\n\nYou can also have multiple source git repositories as well to report activities from several private git repositories.\n\n## Reasons\n\nGitHub shows contributions statistics of its users. There are [several reasons](https://github.com/isaacs/github/issues/627) why this feature could be debatable.\n\nMoreover, this mechanism only rewards developers who work on GitHub-maintained repositories.\n\nConsidering the undeniable popularity of GitHub, developers that use other platforms are disadvantaged. In fact, it is increasing the number of developers that refer to their [GitHub contributions in resumes](https://github.com/resume/resume.github.com). Similarly, recruiters [may use GitHub to find talent](https://www.socialtalent.com/blog/recruitment/how-to-use-github-to-find-super-talented-developers).\n\nIn more extreme cases, some developers decided to boycott GitHub's lock-in system and developed tools that can alter GitHub's contribution graph with fake commits: [Rockstar](https://github.com/avinassh/rockstar) and [Vanity text for GitHub](https://github.com/ihabunek/github-vanity) are good examples.\n\nInstead, [Contributions Importer for GitHub](https://github.com/miromannino/contributions-importer-for-github) aims to generate an overall realistic activity overview.\n\n### Installation\n\nTo install using `pip`:\n\n```bash\npip install git-import-contributions\n```\n\nUsing `brew`:\n\n```bash\nbrew tap miromannino/tap\nbrew install git-import-contributions\n```\n\n### Usage\n\nThe `git-import-contributions` CLI provides an interface for importing contributions into a mock Git repository using data from either a CSV file or other repositories. This tool is designed for developers and operates exclusively via the command line.\n\nThe `git-import-contributions` CLI has two main modes of operation: **stats** and **repo**.\n\n#### General Syntax\n\n```bash\ngit-import-contributions \u003caction\u003e [options]\n```\n\n### Actions\n\n#### 1. Stats Mode\n\nGenerates commits in a mock repository based on a CSV file containing contribution statistics.\n\n**Command:**\n\n```bash\ngit-import-contributions stats \\\n    --csv \u003cpath-to-csv\u003e \\\n    --mock_repo \u003cmock-repo-path\u003e \\\n    --generator \u003cgenerator-type\u003e\n```\n\n**Options:**\n\n- `--csv \u003cpath\u003e`: Path to the CSV file containing contribution statistics.\n- `--mock_repo \u003cpath\u003e`: Path to the mock Git repository.\n- `--generator \u003cfile-extension\u003e`: Type of generator to use for file creation (e.g., `.ts`).\n\n**Other Optional Options:**\n\n- `--max-commits-per-day \u003cnumber\u003e`: Maximum number of commits per day (default: 10).\n- `--author \u003cemail\u003e`: Filter commits by the specified author(s) (optional). Accepts multiple email addresses.\n\n**Example:**\n\nThe contributions are saved in a CSV file `data.csv` as the following:\n\n```csv\ncontributions,date\n4,2024-08-05\n2,2024-08-09\n0,2024-08-10\n0,2024-08-11\n```\n\nLet's import:\n\n```bash\ngit-import-contributions stats \\\n    --csv data.csv \\\n    --mock_repo mock-repo \\\n    --generator .py \\\n    --max-commits-per-day 5 \\\n    --author \"example@example.com\"\n```\n\n#### 2. Repo Mode\n\nImports contributions into a mock repository by analyzing one or more existing repositories.\n\n**Command:**\n\n```bash\ngit-import-contributions repo \\\n    --repos \u003crepo-paths\u003e \\\n    --mock_repo \u003cmock-repo-path\u003e\n```\n\n**Options:**\n\n- `--repos \u003cpaths\u003e`: Paths to the repositories to analyze (required). Accepts multiple paths.\n- `--mock_repo \u003cpath\u003e`: Path to the mock Git repository (required).\n\n**Other Optional Options:**\n\n- `--author \u003cemail\u003e`: Filter commits by the specified author(s) (optional). Accepts multiple email addresses.\n- `--max-commits-per-day \u003cmin max\u003e`: Set a range for the number of commits per day (optional).\n- `--commit-max-amount-changes \u003cnumber\u003e`: Limit the number of changes per commit (optional).\n- `--changes-commits-max-time-backward \u003cseconds\u003e`: Maximum time backward for splitting large commits (optional).\n- `--ignored-file-types \u003ctypes\u003e`: List of file types to ignore (e.g., `.csv`, `.txt`) (optional).\n- `--ignore-before-date \u003cYYYY-MM-DD\u003e`: Ignore commits before this date (optional).\n- `--collapse-multiple-changes`: Collapse multiple changes into one per type of file (optional).\n- `--keep-commit-messages`: Keep original commit messages instead of using mocked ones (optional).\n- `--start-from-last`: Start importing from the last commit in the mock repository (optional).\n\n**Example:**\n\nThe repositories to analyze are in folder `repo1` and `repo2`.\nThe mock repo is instead in the `mock-repo` folder.\n\n```bash\ngit-import-contributions repo \\\n    --repos repo1 repo2 \\\n    --mock_repo mock-repo \\\n    --author \"dev@example.com\" \\\n    --max-commits-per-day 5 10 \\\n    --ignore-before-date 2020-01-01\n```\n\n### Advanced Features\n\nThe `repo` mode supports additional options to control how contributions are imported:\n\n1. **Masking Commit Time**\n   Commit times can be randomized using `--changes-commits-max-time-backward`.\n\n2. **Limiting Changes per Commit**\n   Use `--commit-max-amount-changes` to set a cap on the number of changes in a single commit.\n\n3. **Incremental Imports**\n   Use `--start-from-last` to import contributions incrementally starting from the most recent commit in the mock repository\n\n4. **Ignoring Commits Before a Date**\n   Use `--ignore-before-date` to skip commits older than a specific date.\n\n### Help\n\nTo view the full list of commands and options:\n\n```bash\ngit-import-contributions --help\n```\n\nFor specific actions:\n\n```bash\ngit-import-contributions stats --help\ngit-import-contributions repo --help\n```\n\n### Other good tutorials about this project\n\n- [How I Restored My Git Contributions](https://medium.com/@razan.joc/how-i-restored-my-git-contributions-7ddb27f06d4e) by Rajan Joshi\n- [Import Contributions from Bitbucket to GitHub](https://medium.com/@danielnmai/import-contributions-from-bitbucket-to-github-afd9160eaf6d) by Daniel Mai\n\n## Contributing\n\nWe welcome contributions from the community. Please fork the repository, create a new branch, and submit a pull request with your changes.\n\nEnsure all tests pass and update documentation as needed.\n\n### Install dev dependencies\n\nTo install dev dependencies\n\n```bash\npipenv install --dev\n```\n\nInstall the pre-commit scripts with:\n\n```bash\npipenv run pre-commit install\n```\n\n### Code style\n\nRegarding code styles like indentation and whitespace, **follow the conventions you see used in the source already.**\n\nThe project uses `black` as auto formatter using the settings in `pyproject.toml`.\n\n### Submitting pull requests\n\n- Create a new branch; avoid working directly in the `master` branch.\n- Write failing tests for the changes you plan to implement.\n- Make the necessary changes to fix the issues.\n- Ensure all tests, including the new ones, pass successfully.\n- Update the documentation to reflect any modifications.\n- Push your changes to your fork and submit a pull request.\n\n### Use from source\n\nMake sure you have first of all `pipenv` installed and install all required dependencies:\n\n```bash\n./scripts/install-dependencies.sh\n```\n\nYou can then use the CLI with:\n\n```bash\n./scripts/cli.sh --help\n```\n\n### Tests\n\nIn order to run tests:\n\nMake sure you have first of all `pipenv` installed and install all required dependencies:\n\n```bash\n./scripts/install-dependencies.sh\n```\n\nStart tests with:\n\n```bash\n./scripts/run-tests.sh\n```\n\n### Install from source\n\nTo install from source using `pip`:\n\n```bash\npip install .\n```\n\nTo uninstall\n\n```bash\npip uninstall git-import-contributions\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiromannino%2Fcontributions-importer-for-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiromannino%2Fcontributions-importer-for-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiromannino%2Fcontributions-importer-for-github/lists"}