jenkinsci / jenkinsci/git-client-plugin

[JENKINS-73504] Unable to use a remote git repository which uses SHA256 hashing - fatal: mismatched algorithms: client sha1; server sha256

Open
#1,687 8 comments 1 reaction 0 assignees View on GitHub
component:git-client-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
152
Forks
402
Avg merge
6h 47m
Merged PRs (30d)
4

Description

Hi,

I'm trying to set up a new build job which need to do a checkout from a forgejo/gitea repository.

This repository was created with a SHA256 hash algorithm.

When the jenkins buildjob runs for the first time it creates a local repositiory using the following command:

git init /buildsystem/.jenkins/....


This command creates the local repository with the default hash algorithm, SHA1.

Because of this, it is incompatible with the remote repo, resulting in the following error when fetching the repo.

fatal: mismatched algorithms: client sha1; server sha256


The complete build output: JENKINS-73504">jenkins_git_sha256.txt

Is SHA256 hashing supported, and if not, can it be added?

The local repo creation should be done with the following command:

git init --object-format=sha256 /buildsystem/.jenkins/....

Regards,

Tom

---
Originally reported by toms, imported from: Unable to use a remote git repository which uses SHA256 hashing - fatal: mismatched algorithms: client sha1; server sha256


  • status: Open
  • priority: Minor
  • component(s): git-client-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 20251211-071809

Raw content of original issue

Hi,

I'm trying to set up a new build job which need to do a checkout from a forgejo/gitea repository.
This repository was created with a SHA256 hash algorithm.

When the jenkins buildjob runs for the first time it creates a local repositiory using the following command:



git init /buildsystem/.jenkins/....



This command creates the local repository with the default hash algorithm, SHA1.
Because of this, it is incompatible with the remote repo, resulting in the following error when fetching the repo.



fatal: mismatched algorithms: client sha1; server sha256



The complete build output: jenkins_git_sha256.txt

Is SHA256 hashing supported, and if not, can it be added?
The local repo creation should be done with the following command:



git init --object-format=sha256 /buildsystem/.jenkins/....


Regards,

Tom

1 attachment

- [jenkins_git_sha256.txt](https://issues.jenkins.io/secure/attachment/63009/jenkins_git_sha256.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.