Tag: git submodules

adding a git submodule that tracks master

I’m using git 1.8.4 and trying to add a submodule that tracks master of another repository. I tried adding it as follows: git submodule add -b master /path/to/myrepo.git And I get the following error when I try to add it Cloning into ‘myrepo.git’… warning: You appear to have cloned an empty repository. done. fatal: Cannot […]

How can I pull git submodule automatically?

I am assigned a project, where I will be doing backend development and another person will be handling frontend development. There is a requirement that the frontend developer does not have access to the development server, nor the project code. So, we decided to create another repository just for frontend. The problem is that I […]

How to create two Git repositories in the same base directory, without using branches?

We are currently in the process of moving our Magento Enterprise (an e-commerce web application) files into Git. The httpdocs/.gitignore file contains, among other things: app/design/frontend/company/website/ skin/frontend/company/website/ After initializing, committing and pushing httpdocs/, our first Git repository was successfully created. We now want to put both of the aforementioned directories into their own, separate repository. […]

Make changes to a git submodule and then add those into my main project

I have a git project P. Within my project P is a submodule Q that was cloned off a 3rd party library’s master branch. P | – src – Vendor | – Q I do not have permission to make push any changes to the 3rd party library’s remote repo. I made some fixes in […]

Recommended workflow for multiple modules (themes)

I have an app (cms) which structure is like this: BASE: /application/ /public/ themes/ default/ mobile/ This is a base, central repository for all our projects. Then the projects get their own skin: (which are based on /default/ theme) CLONE1: /application/ /public/ themes/ default/ mobile/ own/ … own-theme-12/ (this app has 12 custom themes based […]

Git: how to accept “theirs” version of a submodule conflict?

In case of a submodule conflict (i.e. when the two commits to merge contain different changes of the referenced commit), how can I easily set the submodule to “theirs” commit? In case of files, I would perform: git checkout –theirs <file> However this does not work for submodules. On a more technical level, what I […]

git submodule conflicts during rebase causes commit to disappear

I have this following scenario that keeps coming back: I commit a change in some files, along with an update to a submodule. Someone else commits and pushes an update to the same submodule. git pull –rebase, I get a conflict I fix the conflict by adding the latest version of the submodule. THE PROBLEM: […]

Is deleting old branches in Git submodules safe w.r.t. usable history of 'supermodules'?

If I use a workflow like this: app_repo and app2_repo have a common submodule, library_repo. In library_repo, I make a library_feature branch to work on a new feature while leaving master stable. app2_repo needs the new feature, so I track the submodule development in it (i.e. I update the submodule reference as commits are made […]

permission denied for certain git path

I need to clone a submodule from a gerrit server to my local project. Here’s a .gitmodule file that works: [submodule “blah/blah/thing”] path = blah/blah/thing url = ssh://my_username@gerrit.somewhere.com/some-thing.git Here’s a .gitmodule file that I would like to work because it works for other team members: [submodule “blah/blah/thing”] path = blah/blah/thing url = gerrit.somewhere.com:some-thing.git When I […]

Why can't I add back a git submodule after removing it

I tried deleting a submodule and then adding it back with git An submodule asub was added by git submodule add -b master url_asub.git. I removed the submodule by git rm asub The asub directory is gone. I then tried to add it back again with the original command that added it (to test […]

Git Baby is a git and github fan, let's start git clone.