jenkinsci / jenkinsci/git-plugin
[JENKINS-47733] Add a withGit pipeline step that provides git credentials
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
It would be nice if we had a withGit step that would pre-configure the git credentials from the current "scm" object and allows us to invoke git from the command line as follows:
withGit {
sh 'git fetch'
}
The step would rely on the same GIT_ASKPASS mechanism as used during a "standard" checkout.
---
Originally reported by brenuart, imported from: Add a withGit pipeline step that provides git credentials
Raw content of original issue
It would be nice if we had a withGit step that would pre-configure the git credentials from the current "scm" object and allows us to invoke git from the command line as follows:
withGit {
sh 'git fetch'
}The step would rely on the same GIT_ASKPASS mechanism as used during a "standard" checkout.
4 attachments
- [mktemp.groovy](https://issues.jenkins.io/secure/attachment/43509/mktemp.groovy)
- [rmdir.groovy](https://issues.jenkins.io/secure/attachment/43511/rmdir.groovy)
- [utils.groovy](https://issues.jenkins.io/secure/attachment/43510/utils.groovy)
- [withGit.groovy](https://issues.jenkins.io/secure/attachment/43504/withGit.groovy)
Contributor guide
Assessment
This issue has not been assessed yet.