Ever wanted to include your private repository contributions to your contribution panel? Well now you can. This script will read from existing repositories and transcribe all of the commit messages into dummy repositories that you can then add publicly to your GitHub account. This script transfers no source code, only commit stubs and their associated dates. This script can be ran multiple times and will update the dummy repo as you go.
[
{
"target_repo" : ["/home/brian/myrepo","/home/brian/myrepo-old"],
"target_email" : ["brian@example.org","bob@otherexample.com"],
"dummy_repo" : "/home/brian/dummy_myrepo",
"dummy_repo_data" : "/home/brian/dummy_myrepo/data",
"dummy_email" : "brian@example.org",
"dummy_name" : "Brian Seymour",
"dummy_readme" : "This public repository reflects the commits from a private repo (minus the actual code)",
"dummy_ext" : ".js",
"dummy_code" : "'use strict';",
"hide_commits" : false,
"random_file_name" : false,
"auto_push" : true,
"force" : false,
"remote" : "https://github.com/yourname/dummy_repo"
},
{
"target_repo" : ["/home/brian/myotherprivaterepo"],
"target_email" : ["brian@example.org"],
"dummy_repo" : "/home/brian/dummy_myotherprivaterepo",
"dummy_repo_data" : "/home/brian/dummy_myotherprivaterepo/data",
"dummy_email" : "brian@example.org",
"dummy_name" : "Brian Seymour",
"dummy_readme" : "This public repository reflects the commits from a private repo (minus the actual code)",
"dummy_ext" : "",
"dummy_code" : "",
"hide_commits" : true,
"random_file_name" : true,
"auto_push" : true,
"force" : true,
"remote" : "https://github.com/yourname/dummy_privaterepo"
}
]
Here you must provide the absolute path to the Git repo that you want to transcribe from. The directory must exist and contain a .git folder inside.
Here you must provide the email address the script should search for in the repo being transcribed from. This makes it so only your commits will come out and into the repo being transcribed to.
Here you must provide the absolute path to the folder you want the script to transcribe to. The directory must not exist.
Need Files to add... and is used to help with language statistics. To use random file names just set "random_file_name" to true.
Here you must provide a new email address the dummy commits will be made as. This will most likely be your GitHub email address so GitHub can properly associate the commits with your account.
Here you must provide the name the dummy commits will be made as. This really has no bearing, but, it should be your name.
Here you must provide the actual text to the readme file associated to that specific repo
Recommend using whatever primary language your private repo is...
Needs to be a short snippet of code reflective of the language your private github repo is
You may not want to show the commit messages in your dummy repo. If this is the case, set this to true and a simple "private commit message" commit message will be put instead.
If this is set to true, you'll be prompted for your repo credentials for the push.
If this is set to true, you'll be prompted for your repo credentials for the push. (use this if you're re-doing a run from scratch)
Here you must provide the GitHub URL that your dummy repo resides at.
python gitdummy.py
- Added random file name to completely hide commit data (LeonardoCardoso)
- UTF-8 support (sepehr)
- Filename truncation to abide by OS imposed 255 char limit (nicolelehrer)
- Python 3 support (ebrian)
- Custom readme content per repo (omarfouad)
- Clean up and bug fixes (oehokie)
- Added Language Statistics (oehokie)
- Compatible with older versions of git cli (oehokie)
- Arrays for email and targets instead of multiple entries (oehokie)
- JSON based repo transcription (ebrian)
- Removed single run limitation (ebrian)
- Private commit messages (w2pc)
- Single repo transcription (ebrian)