Upgrading GIT on Jenkins Master (Windows Server 2016) from Git-220.127.116.11-64-bit to Git-2.37.1-64-bit is causing below issue for Jenkins Multi Branch Pipeline
git config remote.origin.url returned status code 128:
stderr: fatal: not in a git directory
It is quite unlikely that an upgrade of command line git is the root cause of that change. Check for other changes that happened at roughly the same time.
it means the directory your running the command in is not a git repo. check pwd() to confirm your in the right directory
I had even reverted back all changes only this change is causing this issue.
Reverting GIT for Windows to Git-18.104.22.168-64-bit there are no issues
Apart from Jenkins and Plugin update there are no other changes.
Also i am not getting any workaround for this as once i downgrade the GIT version things works
There is no issue in configuration as downgrading GIT Pipeline works fine
You are free to choose to not upgrade command line git. I suspect that you’re seeing some other issue that you are mistakenly attributing to the command line git upgrade. It could be that you need to define a host key verification strategy if you’re accessing the repository with ssh. It could be that you need to perform some other change. I don’t know.
I’ve not seen a case in a very long time where an upgrade of command line git broke an interesting use case. I’m running command line git 2.37.1 on all my Windows computers without any issue. The ci.jenkins.io Windows agents are running command line git 2.37.11 on their agents. Other Windows agents in the Jenkins infrastructure are also running command line git 2.37.1. If there is a problem with command line git 2.37.1, then it is somehow quite special to your environment.