seotore.blogg.se

Git submodule set branch
Git submodule set branch











  1. #GIT SUBMODULE SET BRANCH HOW TO#
  2. #GIT SUBMODULE SET BRANCH MANUAL#
  3. #GIT SUBMODULE SET BRANCH UPGRADE#
  4. #GIT SUBMODULE SET BRANCH CODE#

To answer this you need to understand a little bit about how git stores objects. Note also that version 1.7.0 and later versions of git have some annoying differences in behaviour, which are noted below. (As a small point of interest, to find out which tagged releases had these fixes, I cloned git.git and did git tag -contains 496917b.) The second problem which compounded this is that if you spelled the submodule name with a trailing slash (as is common with tab-completion) then that did not refer to the submodule, and due to the previous problem would be ignored. The first of these is that if you had a typo in the name of a submodule listed on the command line, that would be silently ignored.

#GIT SUBMODULE SET BRANCH UPGRADE#

Many actions that you might perform that relate to submodules are done with the git submodule command, but in older versions of git this has two problems that make it very easy to get confused – I think these are important enough that everyone who uses submodules should be aware of them, and ideally upgrade their copy of git to a version that doesn’t have these problems: at least version 1.6.2. … it’s worth checking what version of git you have. (More on that below.) If you change directory into the submodule then you’ll find that it doesn’t know anything about the the parent project at all, and you can carry out operations in that repository as if it were standalone.

#GIT SUBMODULE SET BRANCH HOW TO#

It’s important to understand that the repository which contains a submodule knows very little about it except for which version it should be and various bits of information about how to update it. (I’ll sometimes refer to the whatdotheyknow repository as the super-project, which I hope is clear.)

git submodule set branch

In each project the commonlib repository has been added as a submodule.

#GIT SUBMODULE SET BRANCH CODE#

The example I’m going to use in this post however, called whatdotheyknow, is one of the various mySociety projects that depend on a repository called commonlib, which contains useful code common to at least one project. For example, if you’re developing a new Ruby-on-Rails application, you could add a clearly specified version of the Rails repository as a submodule at the path vendor/rails. This is a useful feature when you have a project in git which depends on a particular versions of other projects. What are submodules?Ī submodule in a git repository is like a sub-directory which is really a separate git repository in its own right.

git submodule set branch

#GIT SUBMODULE SET BRANCH MANUAL#

Submodules in git are commonly misunderstood in various ways, and although the explanation in the official manual is clear and pretty easy to understand, I thought that a different treatment here might be useful to someone. n( Thread.java:748)Ĭaused: java.io.IOException: Could not perform submodule updateĪt .(SubmoduleOption.java:113)Īt .checkout(GitSCM.java:1270)Īt (AbstractProject.java:1208)Īt $faultCheckout(AbstractBuild.java:574)Īt (SCMCheckoutStrategy.java:86)Īt $n(AbstractBuild.java:499)Īt (Run.java:1818)Īt (FreeStyleBuild.java:43)Īt (ResourceController.java:97)Īt (Executor.I haven’t actually finished the FAQ bit of this post yet, but since I’m not sure when I’ll have time to do so, I’ll just publish it anyway – please let me know in the comments if this is useful for you, or there’s something else you’d like to see included.

git submodule set branch

revision in submodule path 'curavi-common' at .CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)Īt .CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)Īt .CliGitAPIImpl.access$400(CliGitAPIImpl.java:72)Īt .CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1202)Īt .RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)Īt .RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)Īt (UserRequest.java:212)Īt (UserRequest.java:54)Īt $2.run(Request.java:369)Īt $1.call(InterceptingExecutorService.java:72)Īt .run(FutureTask.java:266)Īt .runWorker(ThreadPoolExecutor.java:1149)Īt $n(ThreadPoolExecutor.java:624)Īt java.lang. : Command "/usr/bin/git submodule update -init -recursive -remote curavi-common" returned status code 1:













Git submodule set branch