github limited access to project folders - github

I have a github repository with few folders in it. What I would like to achieve is that I want to provide access to shared users to only particular folders. How can I achieve this?

I think using a Git submodule might give you what you want here. Submodules behave like repositories which effectively live inside of another repository. You could place the shared code into a submodule and then only grant permission to this section of the parent repo for shared users. Your shared users would not have permission to the outer parent repo.
Have a look here for more information: Does GitHub have built-in support for submodules?

Related

Copy all repos of an organisation to another account

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.

Is it possible to group git repositories into subfolders under AzureDevOps?

Recently, we migrated from our TFVC to git repository. I would like to decouple a few of our solutions into separate git repositories. Is it possible somehow to group these newly created repos under some kind of subfolder on AzureDevOps?
Is it possible to group git repositories into subfolders under AzureDevOps?
The answer is yes.
The most important thing before starting is to backup your current project/solutions.
I created a simple example to demonstrate how to accomplish it.
I created a repo with three solutions (Solution1, Solution2, Solution3)in it:
Add three subfolders (Subfolder1, Subfolder2, Subfolder3)in this repo via Azure devops web page:
Now, open our Visual Studio locally, connect to this repo. And move the solution1 to the subfolder1 in the file explorer:
Then, push this change to the repo:
Now, the solution1 moved to the subfolder1.
Update:
But basically my question was if there is possible to create
subfolders for some git repositories, not a subfolders inside git
repository
I think it is impossible to create subfolders for some git repositories. You need to create other repo in the project. When you have lots of repos, folders aren't your best friend. Tagging, quick-filter and search are.
Please check this thread for some details.

Github Pro: How to give read only access to a private repository?

We have a Github pro account and have a Github repository for which we want to give read-only access to a few people. They should be able to get the code with this access but shouldn't be to modify this repository in any way.
Is this possible?
If your goal is to allow them to clone the repository but still modify it on their own system, you can do this by either assigning them as collaborators on the repository with the read privilege under Settings → Manage Access.
If your goal is to prevent them from modifying the repository even on their own systems once it's cloned, then that isn't possible.

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 can I limit contributors to sub directory of a Github repository

We use GitHub to host our private repository. We have multiple contributors who working on the project as contractors.
We want these contributors with limited access to only make changes to a subdirectory within the repository.Additionally, we want these contributors to read the code only within that subdirectory.(in other words anything above the subdirectory is not readable to the contributor. Is there a way to do this on Github?
Why don't you just make additional repositories out of the subdirectories?