If you want to use ssh credentials,
git(
url: 'git@github.com.git',
credentialsId: 'xpc',
branch: "${branch}"
)
if you want to use username and password credentials, you need to use http clone as @Serban mentioned.
git(
url: 'https://github.com/.git',
credentialsId: 'xpc',
branch: "${branch}"
)