0 users online. Create an account or sign in to join them.Users

Search

  1. I cloned the Symphony repository.
  2. I created a branch for my website.
  3. I'm pushing this branch to a private repo on bitbucket.
  4. I started adding extensions as submodules.
  5. If I add my own extensions as submodules everything works ok...
  6. If I add submodules from other authors, I get the error 'You are on a branch yet to be born'.

What's going on here, and how can I fix this?

Hmm... Wich part of Git says that? The main project or a submodule? And are you able to continue working or is it a fatal error?

Also, submodules are purposely not checking out a branch but rather the commit you want them to be (the same as doing a git checkout a7bd54 will end up on no branch).

Not sure which part... It says it's a fatal error:

Giel@GIEL-PC /d/project/folder (custom-branch)
$ git submodule add git://github.com/domain7/html5_doctype.git extensions/html5_doctype --recursive
fatal: You are on a branch yet to be born
Unable to checkout submodule 'extensions/html5_doctype'

Giel@GIEL-PC /d/project/folder (custom-branch)
$

Any thoughts on this?

Hm... it works on my machine. What git version are you using? And have you tried leaving out the --recursive switch?

Nope, removing --recursive doesn't fix it

I'm running 1.7.11.msysgit.1

Have you followed the exact steps?

  • Clone Symphony repo
  • Create branch (and switch to it)
  • Add a submodule to the branch which isn't created by you

Hmm you wouldn't need to change the remote (your private repo set to origin) and do a pull maybe (following the initial push)?

@gunglien: I don't quite understand what you mean.

From what I've read with Google search, it would seem that this error occurs when the submodule is an empty repository with no branches yet, like a git init creates.

Obviously, this isn't the case as we know the repo has content.

It would suggest to me then that there was a problem with git when it tried to pull the submodule's content from the remote.

My suggestion is to upgrade msysgit to the latest version.

sorry for being unclear..

I cloned the Symphony repository. I created a branch for my website. I'm pushing this branch to a private repo on bitbucket. I started adding extensions as submodules. If I add my own extensions as submodules everything works ok... If I add submodules from other authors, I get the error 'You are on a branch yet to be born'.

I don't know... you probably did but is your private repo - set as remote origin; not remote private? If not would switching it help?

Error seems strange though.. never had similar issues yet...

Well that's strange, I updated my Git versions, and it seemed to work, since it was cloning. But when I looked closer, it appeared that I had a typo and cloned the extension into a (new) folder called extension/html5_doctype (instead of extensions).

So when I try to clone it in any other folder than extensions, the submodule gets added, even in the workspace- or symphony-folder. So the problem is now narrowed down by trying to add a submodule to the extensions-folder. What could be going on here?

Would this post on stackoverflow be of any help?

No, it didn't help...

All I can think of now is to just add the files manually to the extensions-folder instead of submodules. Which sucks :-(. Why is it that I can add submodules to every folder of my branch, except for the extensions-folder? Could it have something to do with my configuration or something?

Hurray! It works!

Looks like something went wrong somewhere someway somehow...

Here's what happened: I use a Git GUI called 'SmartGit' to work a bit easier with Git. But it turns out that SmartGit isn't that 'smart' as the name would suggest...

When adding a remote submodule, SmartGit would check for some reason also on my private remote on bitbucket (don't know why, but it does...). This fails.

But... even though it fails, a folder of the submodule remains in the.git/modules/extensions/-folder. After deleting that and adding the submodule using the Git Bash, the submodule gets added:

$ git submodule add git://github.com/domain7/html5_doctype.git extensions/html5_doctype --recursive

On retrospect, when you try to add a submodule, but the URL is incorrect, the same thing happens, and you have to manually delete the submodule from your .git/modules/-folder (note the typo in the git-url):

$ git submodule add git://github.com/domain7/hmtl5_dctype.git extensions/html5_doctype --recursive

This is probably the same reason why SmartGit screwed things up, since they checked on bitbucket for the submodule, which would result in an incorrect URL.

There's probably a neat git-command that will clean the .git/modules/-folder, but for now, my manual deletion of folders seemed to do the trick! ;-)

The Symphony Extensions website has improved my git command line workflow immensely. I just copy and paste to avoid typos/errors and such.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.1
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details