Symlink for a README.md file from another Repository - github

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.

Related

Can I commit into specific folders inside a repository in 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)

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.

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/

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.

Where is git repository of Xcode stored? And Why different repository is created when I copy project directory?

I'm using built-in git of Xcode.
I think my project directory is just a working copy of repository.
How can I know where repository is stored?
And when I copied a project directory, a new different repository is automatically created for new project directory instead of sharing the repository of old project directory.
That is convenient but why that happend?
Git stores the repository in the top-most .git folder of your working directory. So, if your code is in /Users/js/Code/MyProject, then the repository is in /Users/js/Code/MyProject/.git/.
Git encourages every repository to contain a single "project". Although it's possible to store unrelated branches that don't share any history in a single repository, that is very nonstandard and might be confusing to other people.
It's also possible, but discouraged, to store unrelated projects as subdirectories within a single working directory. This would make it difficult to see the history of each individual project, since you'd have to inspect each individual commit to figure out which project it affected, and merges would be downright painful.