I\'d like to access git variables such as GIT_COMMIT and GIT_BRANCH when I have checked out a repository from git further down in the build stream.
GIT_COMMIT
GIT_BRANCH
This example might get you further: https://github.com/jenkinsci/pipeline-examples/tree/master/pipeline-examples/gitcommit
In this example they are piping the output of git commands to a file, and then reading the file.