Jenkins ERROR: Error fetching remote repo 'origin'

Jenkins setup: 2.477

Hi. Im just learning how to use Jenkins. Im using Git with it.
I have small script saved to Git and I managed to run it with Jenkins several times.

Then I closed Jenkins and after reopening it i got several warnins
First warnings were related to crumb… those I manage to get away.

But now i have this error:

22:27:29 Started by user Minerva Järvensivu
22:27:29 Running as SYSTEM
22:27:29 Building in workspace C:\Program Files (x86)\Jenkins\workspace\New Shoes - Chrome
22:27:29 The recommended git tool is: **NONE**
22:27:29 using credential 045daedc-2539-4f9f-93d6-adfeb64acba9
22:27:29  > git.exe rev-parse --resolve-git-dir C:\Program Files (x86)\Jenkins\workspace\New Shoes - Chrome\.git # timeout=10
22:27:29 Fetching changes from the remote Git repository
22:27:30  > git.exe config remote.origin.url https://github.com/minervatanhua/NewShoes.git # timeout=10
**22:27:30 ERROR: Error fetching remote repo 'origin'**
**22:27:30 hudson.plugins.git.GitException: Failed to fetch from https://github.com/minervatanhua/NewShoes.git**
22:27:30 	at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:997)
22:27:30 	at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1239)
22:27:30 	at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1310)
22:27:30 	at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1277)
22:27:30 	at hudson.scm.SCM.checkout(SCM.java:540)
22:27:30 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1250)
22:27:30 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
22:27:30 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
22:27:30 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:522)
22:27:30 	at hudson.model.Run.execute(Run.java:1828)
22:27:30 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
22:27:30 	at hudson.model.ResourceController.execute(ResourceController.java:101)
22:27:30 	at hudson.model.Executor.run(Executor.java:445)
22:27:30 Caused by: hudson.plugins.git.GitException: Command "git.exe config remote.origin.url https://github.com/minervatanhua/NewShoes.git" returned status code 128:
22:27:30 stdout: 
22:27:30 stderr: fatal: not in a git directory

I have no idea what to do with this now. Can someone help me with this…

Hello and welcome to this community, @minervatanhua. :wave:

The error message seems to indicate that Jenkins is unable to fetch the remote Git repository because it is not recognizing the workspace as a valid Git directory. :thinking:

This can happen if the workspace directory is not properly initialized as a Git repository or if there are permission issues. :person_shrugging: