Can I commit into specific folders inside a repository in GitHub? - github

As a part of my traineeship, I'm supposed to create a single repository for my final projects.
Inside that repository I'd have created 3 folders (task, project1, project2).
Since I'm quite new to GitHub, I'm not entirely sure how to achieve that.
I know how to create a new repository, but uploading into a specific folder seems extra confusing for a dodo like myself.
Many thanks in advance.

If you create a new repository (github.com/me/myNewRepo), you can:
clone it locally
cd (change directory) to myNewRepo
create your subfolders there (with files in it)
add/commit and push
You will see those same subfolders in github.com/me/myNewRepo
(Replace Me by your GitHub user account, and myNewRepo by a more meaningful name)

Related

Symlink for a README.md file from another Repository

I'm wondering wheather this is possible with GitHub.
As you can see below, I have two respositories. One is Primary, where I'm writing some of the Common MarkDown files for some of my Projects. Two, is the actual Project Repo, where I want to refer the Markdown file fomr Repo1 as a symlink and render it.
RepoOne -
/abhinavbharadwajr
../absolutebeginner.md
RepoTwo -
/pythonexamples
../Absolute Beginner
../../absolutebeginner.md
Is this Possible? I have seen people creating symlink within a Single Repository, but not like this.
No, that's not possible. First of all, GitHub doesn't check out files from separate repositories on disks. All the repositories are bare, so there's no way to resolve the symlinks outside of the repository. GitHub has no way to know that a repository symlink that points outside of the repository necessarily symlinks to another repository and what that is, since it could point to any possible location.

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.

is it possible to commit all selected projects from Eclipse to one github repository

how is it possible to commit all selected projects from Eclipse to one github repository(as imaged below)?
Currently when I commit my new project to github, a new repository will be created.And I'd like to avoid creating massive number of new repositories.
Thank you in advance!
p.s.I found other related topics for this question, but don't know what I should do exactly.
need your help please.
There shall be an Eclipse plugin that'll do your git job but I'll tell you a generic solution in case that plugin is not helpful. Well, all these selected projects are directories basically and if they're residing inside the same directory, let say <dir-1>, then you can add the remote repo path to <dir-1> using git remote add origin <git-path> and then add all your directories i.e. projects which will be part of the git repo. Best case would be to create separate branches for each of these projects and then merge those branches to master when they reach a logical state without any breaking changes. Now, in case, if all these directories are not residing inside <dir-1> then create a symbolic link inside <dir-1> to all those projects (possibly with same names) so that whenever the original directories are updated these directories are also changed respectively. Check more about symbolic links.

Is there a way to download the zip file for a GitHub repository that includes links to other repositories?

There is a GitHub repository that I would like to download as a zip file. However, some of the code I want to download is located in separate repositories and only a link to those repositories are located in the main repository, not the actual code. If I want a zip file containing the whole codebase, do I need to download the separate repositories and assemble it, or is there a way to do it?
Not directly from GitHub: the tarball or archive representing a repo does not include its submodules, assuming the repo has a .gitmodules file.
Only a git clone --recursive (maybe with --depth=1) would get you a complete content.
Note: if the repo does not have a .gitmodules file, those references are just gitlinks to other repo SHA1, without their URL, in which case even a regular clone would not get their content.
If I want a zip file containing the whole codebase, do I need to download the separate repositories and assemble it?
Yes, ... except you might end up with the wrong content: the main parent repo does reference other repos specific SHA1, so you need to make sure to query an archive for the right reference.

Create repository in Mercurial under subdirectory in root

I am using bitbucket for creating repositories for Mercurial.
I've create a repo: https://glukamin#bitbucket.org/glukamin/aw2012merc
Now, I've also committed an empty folder, "asd" in that repo. It has .hgignore in it.
I would like to set my repository in that folder, "asd".
So, basically it should look like this: https://glukamin#bitbucket.org/glukamin/aw2012merc/asd -> if that is possible, which should be my main repo after setting it.
I am really new to Mercurial and as far as I could understand it, .hg should be created in that folder. I don't know how to do that. I am reading about Mercurial online and trying to understand it better but I need help on this. I am also using Mercurial.NET.
Thanks,
Mercurial does not track empty directories and as such they can neither be added nor committed. Are you sure you didn't add in that process the .hgignore within that directory to your main repository?
However: It's easy to create a(nother, new, unrelated) repository within a sub-directory. Just go to that sub-directory and execute hg init and you're done; you then have a new repository residing there without any commits to it. It does not affect the repository which might rule the parent directory.
I suggest to read the hg book: http://hgbook.red-bean.com/