If you want to use ssh credentials,
git(
url: '[email protected]<repo_name>.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/<repo_name>.git',
credentialsId: 'xpc',
branch: "${branch}"
)