Create repository in Mercurial under subdirectory in root - version-control

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/

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.

what Git Ignore field means in github desktop while creating a new repository

see the Git Ignore option in the below image.What I have to choose, I am creating an ionic-framework repository.
https://i.stack.imgur.com/pBvkd.png
.gitignore is a file which, Git uses to determine which files and directories to ignore, before you make a commit. These files/directories will not be pushed into the repository.
If you have any files or directories that don't need to be pushed into the repository, then you can include them. (a simple example : log files)
If there is no ionic option, you can ignore it, and create it locally on your repo, then push it back to your GitHub repo.
To create it, see https://www.gitignore.io/api/ionic3
It does generate an Ionic .gitignore for you.

Symfony vendors in git project

I have a Symfony project, which was always held in an svn project.
Now I am trying to make the move to git (on github).
The problem is that
git status
always tells me that there are modified and new files/folders, which I cannot seem to commit...
When I
git add
these files/folders, then commit will just tell me I have nothing to commit, and that the files/folders are still untracked?
All the other stuff in my Symfony project is committed and pushed file, its just certain stuff in the vendors folder which I can't seem to get going.
How can I fix this?
ps: I am also having trouble getting composer to update my vendors.
My best practice is to completely ignore the vendors directory, and install all the vendors bundle with composer on every development machine using composer.json and composer.lock (thus, you will need to add these files to your repo!)
i guess it has to do with the fact that the vendors also have .git folders inside of them
I confirm a nested git repo won't respond well to git command, if that nested repo already consider said files committed.
Or, at the very least, you should add those files while being within that nested repo (not from a parent directory).
However, a git status done in a parent directory should ignore the content of that nested repo. See How to make top-level git to track all the files under another sub-directory git .

VCS: push only source code directory

I work on Java project. How I can push only source directory without temporary files, build files and project files? I use Mercurial.
Mercurial will only push history, which means that it is only things that you have asked it to track (with hg add) and later committed (with hg commit) that will be pushed.
So like Jim says, you should setup .hgignore file. Do this before adding files to your project and double-check that hg status only lists files you want to add. Then run hg add to add them all.
If you've already put the temporary files and build artifacts under version control, then you can either use hg forget to stop tracking them. You'll still carry them around in the history, so if we've talking about tens of megabytes, then you probably want to re-create the repository.
Create an .hgignore file.

Mercurial Syncing only selective folders from Central Repository

I have a central mercurial repository, and have many folders and code in there. I want to be able to sync only selective folders in my windows to be able to build the project and all folders in linux to build the same project n linux. Syncing all folders from central repository is easy
hg clone <repo address>/repo
but how do i sync only selective folders using the clone command
Something like Perforce's Workspace equivalent.
I guess we can write a script with some 'call' command, i tried googling for it, and could not find proper pointers to it.
Can somebody link me to it please.
Thanks in advance
Sounds like what you want is Mercurial's Subrepositories
Mercurial doesn't work on a per-directory basis. It operates on changesets, and changesets are global to the repository. So, no, you cannot clone only one directory, you can only clone the entire repo.