How to find which repos a repo depends on at Github? - github

I want to find out which repos a repo depends on at Github.
Now I can only find the dependent repos of a repo, that is, which repos depends on a repo.
Can I find the repos in the reversed way at Github?

Since May 23rd, 2019 (two years later), you now have "Dependent repositories"
Dependent repositories surface data from the GitHub dependency graph, showcasing which public repositories depend on the packages in that repository.
See more at "Listing the projects that depend on a repository"

It depends on your notion of "dependencies".
In term of Git repositories, one clear dependency is the notion of submodules
On GitHub, simply check for the presence of a .gitmodules file, you you would get in it the list of the url of dependent repository.
But the reverse wouldn't be easy to get: for a given repo, is is harder to find the list of repositories using it.
Maybe try a GitHub code search, limiting its search to files with extension .gitmodules.
Example: vysheng/tg extension:gitmodules: you see the list of repos using vysheng/tg as a submodule that way.

Related

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.

what is the difference between github project and project inside repository?

I know this question sounds dumb, but I am unable to understand the difference between the main project and project option provided inside each repository.
Are they same? (But the URL differs)
I looked at help.github.com
but it doesn't help.
I basically understand that for larger projects management, project inside repository is helpful.
on what uses cases, they provided the another project outside of repository and linking those repositories to it?
Is that for structuring?
There is a repository on github (sometimes called a "project") where you store your code. You change the code, make a git commit, and push those code changes to the github repository.
GitHub also has a feature called "projects" which provides you a method for managing the work that needs to be done on the code. GitHub also has "issues", an issue tracker. You can use the GitHub Project Board to organize your GitHub issues, giving you a way to see see where things are at in your effort on the code.
You can turn off the "projects" and "issues" features in the repository settings, you don't have to use them. The center of work is the code in the repository, which might be referred to as a project -- the Projects feature lets you manage your issues in GitHub in a more visual format.
The difference is in the scope. The "main project" (user-owned project board) can have issues and pull requests from multiple repositories whereas the "project in repository" (repository project board) can contain only the issues and pull requests belonging to that repository.
From the Project boards docs:
Types of project boards:
User-owned project boards can contain issues and pull requests from any personal repository.
Organization-wide project boards can contain issues and pull requests from any repository that belongs to an organization. You can link up to twenty-five repositories to your organization or user-owned project board...
Repository project boards are scoped to issues and pull requests within a single repository. They can also include notes that reference issues and pull requests in other repositories.

github: referring another project file revision

To prevent copy/pasting foreign code to my github repository I would like to refer from my project (in specific dir) another project files (of the specific revision)
To make things clear I'd like to achieve situation like in this repo: https://github.com/husio/vim-configuration/tree/master/bundle
How can I do so?
Not sure if it's a github only feature, or somehow git itself supports it.
You are looking for git submodules. It is a feature of git, but GitHub's file browser will resolve submodules when you view them on the site (which is what you can see in the repository you linked to).
Note that while submodules let you choose their location (within your repository), name, and commit (from the submodule's repository), they will include the entire trees of the original repositories. If you only want specific files or directories, check out subtree merge instead.

GitHub wiki managed by the main repository

I'd like to manage the GitHub wiki for my project at the same time as I'm developing the code. For example:
Branches
master (stable versions)
develop (development of next version)
Others... (Possible other dev / feature branches)
Ideally, I'd like the wiki to be contained in a subfolder (e.g. /wiki) of the project. Then when I'm making changes to the code I can also update the wiki as the same time (code + documentation change). It'd also mean that all my development code and documentation would be self-contained in the "develop" branch until I merge with the "master" branch. Hopefully, even if via a manual process, the GitHub wiki would then be updated after the merge with master to reflect the changes.
I've taken a look at Git's submodule feature, but from what I understand that usually points at a single revision. I'd like to somehow follow my code development so branching and merging would work as normal.
As explained in "True nature of submodules", you can make modifications and updates within a submodule, as long as you commit also the parent repo in order to record the new state of your "wiki" sub-repo.
If you intend to use Gollum to display and work on your GitHub wiki while it's on your local machine (you probably should), then you will have a trouble if you use submodules.
Gollum wants to do local commits to your local Git repository (but not pushes), but in a submodule .git is actually a file containing the local repository, not a true Git repository. This causes Gollum to break.
Submodules also have the problems that the versions aren't coupled to the parent repository, and they aren't completely de-coupled. It a nuisance to have the source code repository to want to push the new wiki version number (but not the wiki contents) every time you make a documentation change.
The solution I use is simply to clone the wiki repository into a directory inside the main project directory and add it to .gitignore. By using a consistent name for the directory across projects (e.g. github-wiki), the chance is minimized that the wiki won't be in .gitignore and gets accidentally uploaded into the main repository.
For consistency, his approach also works well for GitHub pages, although it's unnecessary as they don't experience the problem with Gollum.

Git: Access Control? How to do in practice

how would one protect a GIT repository of a complete (java) application from having a developer getting access to all the source code in the repository. I know GIT is a distributed Versioning Control where a developer normally "downloads/fetches" the complete(!) repository.
My Questions:
How to sperate "modules/autonomous parts" in git? For example havng a module "payment layer" and "database layer" and "processing layer" and so forth all abstracted via APIs/Interfaces. Do i have to setup a seperate git repository for all those modules?
Is there a way to have one large repository in GIT but to somehow restrict the access by path? (A client should only recive those files he was granted access to)
Is there a way to have one large repository in GIT but to somehow restrict the access by Branch/Tags? (A client should only recive those files he was granted access to)
Just in Case someone knows this too: Is there a way in eclipse to chekout content from multiple GIT repositories into one project and also (the other way round) commit code within in one eclipse project to multiple different GIT repositories (based on package names/paths or in the context menu)?
Thank you very much
Markus!
You will have to split up the code into multiple git repositories if you want differential control. You cannot control by branches or whatever. Git downloads the entire repo. Period.
You can look into git modules for a mechanism for making it easier to work with a thing built of multiple git repositories.
1) and 4) depends a lot of your build evironment. In git you try to have separate repositories per modules, but if the setup of the source tree becomes painful you can use git submodules (though not much people like them) or the repo tool the Android project uses. This allows you to have an "umbrella" project composed of more subprojects. Not sure if it is worth it for just a few components. Just one git repo may still make more sense.
For questions 2) and 3):
For access, I would recommend that every sub-team keeps its own fork (repository) and somebody reviews what they push to the integration repository. If you don like this approach, you can use git server hooks to enforce policies writing scripts.
In this case, the hook could check who is pushing, and the path or refspec (branch) against some config file describing the policy. This is documented here:
https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy
1). Look at Git submodules http://linux.die.net/man/1/git-submodule
2,3). Look at Gitolite https://github.com/sitaramc/gitolite/blob/pu/doc/gitolite.conf.mkd
4). I don't think any eclipse-git plugins allows that. However, you can use an external/command-line client to achieve what you want.