Copy all repos of an organisation to another account - github

I'm part of an organisation on github and would like to copy all the repos of that organisation to another regular github account at once.
I thought there would be a tool to help me to do this easily but haven't found one yet. What would be the easiest way to approach this? Thank you
I have tried looking into gh but I'm not sure it's the right tool for it. All I'm trying to do is basically cloning all the repos of the organisation I am a part of to another github account in one go

I have tried looking into gh but I'm not sure it's the right tool for it.
Considering there does not seem to be a native feature allowing for a bulk copy you want, gh is actually a good option.
Depending on the fork policy of your organization and the nature of said repositories (public or private), you should be able to write a script, using the GitHub CLI gh, which would:
list the repositories of an organization (gh repo list)
fork it (gh repo fork)
Note that will not copy issues or pull-requests.

Related

Adding GitHub Team and Repo Admins to Repos Created From Template

I have a couple questions related to GitHub template repositories. My team regularly creates repositories from a GitHub template repository. We also have a GitHub team and like to add all of our repositories to our team.
My questions are:
Anytime a new repository is created from our template repository, how can it be automatically added to our GitHub team's list of repositories?
Anytime a new repository is created from our template repository, how can myself (and someone else) automatically be made admins of this new repository (even if we didn't create the repository)?
I've searched all over documentation and Stack Overflow for possible solutions but came up empty handed. I've looked into using CODEOWNER files which might be useful, but don't look like they're designed for this use case. I've also looked into creating new repositories from the GitHub CLI using the template repository and maybe a shell script to add it to our GitHub team, but was hoping for a simpler solution.
Thanks for any thoughts or suggestions!

How to unlink a DevOps repo in Databricks Repos?

I linked this DevOps repo inside my Databricks workspace Repos, but now I want to get rid of it.
And no matter how much I've searched, I can't find a way to do something that looks this simple.
I would have expected a button or an option like "Remove Repo", but that doesn't exist.
This is what I mean.
Thank you.
To get rid off existing repo, you need to add new repo.
You can add new repo using below steps.
Here you need to provide URL of new Git repo
If you want to select other Git provider. Go to User Settings you can remove Azure Devops Services and select your preferred Git provider from the dropdown list.

Pushing to multiple github repo at once

Is there any easy method to push\upload a file to multiple github repositories at once?
without need to first clone them to local machine. kinda script or cli\gui tool?
I searched across Google, but seems nobody asked\wanted the same thing..
What i trying to achieve is to upload a new renovate.json config to all my repositories under one github account (some of them public, some private, more than 60 repos at all)
What you request is an error prone method. For example, How do you expect the tooling to resolve merge conflicts when they occur in multiple repositories?.
If this file is indeed a shared component. I would recommend to use submodules.

How can I create a complete offline archive of a GitHub repository?

We have some repos that we no longer need to keep on GitHub. If we use GitHub's archiving feature, the repos actually stay online. What we'd like instead is a way to download an archive of all the content (including issue reports) for a given repository, put that repository archive in a long-term preservation system, and delete the repo from GitHub. This is more than simply backing up a repository in the sense of other similar questions on Stack Overflow, and is more like what BackHub can do. Is there a tool or set of procedures (beyond git clone) that will allow me to do this?
python-github-backup can back up a single repository in an organizational account, as well as all repositories in an account. I have tried it on individual repositories, and it worked as hoped: using its --all option, it captures issues, labels, milestones, pull requests, and wiki pages, as well as the repo itself.
Googling "github-backup" leads to other similar tools, but most of the others seem to have fewer features than python-github-backup or haven't been updated for many years. However, I must admit I haven't explored the other options very carefully.
Tip: the essential ingredient in using Google to find a suitable tool seems to be to search for the words "github" and "backup" specifically, and not include "archive" as I was doing in my original search, or even use more elaborate search strings such as "how make backup github repository".
If is preferable to use git clone --mirror, to get the full repo history and then
git bundle --all to get only one file (easier to store than a collection of files)
a long term storage system (example AWS S3)
Notes:
you might want to clone the associated GitHub wiki as well, if you have one.
that won't preserve your issues/Pull Requests
Use a folder on your local machine, google drive, or dropbox. No need to use github on non-active projects.

How do I checkout a GitHub project from command line as a Collaborator?

This seems like a simple question which should have a simple answer...
I'm trying to checkout a GitHub project. The project is owned by someone else, so someone else is the Owner. GitHub Collaborators have read/write access, and I have been granted collaborator rights on the project. Collaborators are slightly different than Contributors, who have simply provided a pull request in the past.
I'm trying to avoid the following because I do not want the source files in "read-only" mode:
git clone https://github.com/user/project.git
I feel like I need to identify myself, and send my password or SSH key. But GitHub's help at Which remote URL should I use? only discusses SSH in the context of a Desktop client. I guess they have an app they want me to use, but I don't really want to use one.
Note: I have information in Git's global config (user.name and user.email), but its not the correct information/credentials for these purposes.
How do I checkout a GitHub based project as a Collaborator from the command line?
Using the the HTTP endpoint instead of the the SSH one.
As an aside, when you say checkout do you mean clone, fork or pull?
for clone it would be similar to this:
git clone https://github.com/user/project.js.git
You will be prompted for your user name and password.