I would like to be able to use git to clone the issues for various projects on github. I know I can clone the code and the wiki (if it exists). I cannot find a way to clone the issues.
As a worked example, here's how I would clone the main repo containing the project's source code:
git clone https://github.com/kiwix/kiwix-android.git
And this works for the wiki pages of this project:
git clone https://github.com/kiwix/kiwix-android.wiki.git
I've tried the following to see if it would work for the issues, but it doesn't
git clone https://github.com/kiwix/kiwix-android.issues.git
Cloning into 'kiwix-android.issues'...
remote: Repository not found.
fatal: repository 'https://github.com/kiwix/kiwix-android.issues.git/' not found
Being able to clone the issues would be a great help, particularly to run scripts to analyse the set of issues for various problems, etc.
Thanks to @madhu-bhat's suggestion I read the documents on GitHub's v3 API and discovered examples such as
curl -i "https://api.github.com/repos/vmg/redcarpet/issues?state=closed"
which I then revised to get the open issues for one of our projects:
curl -i "https://api.github.com/repos/kiwix/kiwix-android/issues?state=open"
This approach does what I need and allows me to filter by the state, etc. +1 for StackOverflow.
It is not possible to clone issues of GitHub repositories. An alternative for you to get the issues' data would be to use the GitHub APIs.
Check out the documentation here to get issues for a repository.
GET /repos/:owner/:repo/issues
You can get the issues' data using the API, store it in file system and then run your necessary scripts on them.
Kamino requires the Chrome browser and I was not willing to work with an extension. Additionally, I wanted to clone issues from a private repo A
to a public repo B
, which I was not able to do with the copy issue
button.
So a bit of Python code was written that copies all open issues from repo A
to repo B
. It is located here: https://github.com/a-t-0/batch-copy-issues and you can use it as:
git clone [email protected]:a-t-0/batch-copy-issues.git
cd batch-copy-issues
conda env create --file environment.yml
conda activate batch_copy_issues
python -m code.project1.src
Then it asks you for the GitHub username and repository from which you want copy the issues, and to which GitHub user and repository you want to copy them to. Next it gets a browser controller, ensures Firefox is installed and starts copying the labels, titles and comments of open issues from repo A
to repo B
. You can watch it copying the stuff.
Please not this is not an exact "Clone" of an issue, since it does not properly conserve "who said what", since all comments will be written by the person copying the issues. The software would be able to include a small footnote saying originally said by X at time Y.
, however that is currently not implemented.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With