Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git submodule update --init gives error fatal: Needed a single revision Unable to find current revision in submodule path

Tags:

git

jenkins

When i execute git submodule update --init I get error

fatal: Needed a single revision Unable to find current revision in submodule path 'plugins/pluginname'.

Actually I was trying to run a Jenkins Job to deploy it. I added Recursively update submodules as additional behavior in Jenkins. FATAL: Command "git.exe submodule update --init --recursive" returned status code -1: This is occurring only from my local as same command is working for others.

like image 342
Biplab Biswas Avatar asked Jul 06 '16 15:07

Biplab Biswas


People also ask

How do I initialize a git submodule?

If you already cloned the project and forgot --recurse-submodules , you can combine the git submodule init and git submodule update steps by running git submodule update --init . To also initialize, fetch and checkout any nested submodules, you can use the foolproof git submodule update --init --recursive .

What is git submodule sync?

git submodule sync synchronizes all submodules while git submodule sync -- A synchronizes submodule "A" only. If --recursive is specified, this command will recurse into the registered submodules, and sync any nested submodules within.

How do submodules work in git?

A git submodule is a record within a host git repository that points to a specific commit in another external repository. Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.


1 Answers

Try git submodule foreach git pull

like image 181
Francis Bacon Avatar answered Sep 20 '22 14:09

Francis Bacon