If you only have one remote repository (named origin
), then entering branchname
should be synonymous with entering origin/branchname
. If you have multiple repositories and you just enter branchname
then it should be checking all of the remote repositories for that branch.
Note that if you manually created a branch named branchname
in the Jenkins workspace repository, then it may have slightly strange behavior, and you'll probably want to delete that branch or recreate the workspace. In general you should never manually manipulate the branches in the workspace repository.
It should never be trying to use local (non-remote) branches for polling or getting changes. If you are seeing it do this, then it's definitely a bug. You should try to upgrade your jenkins instance and git plugin to the newest version, and if you still see the problem you should file an issue (and in the meantime you could use origin/branchname
as a workaround). However, entering just branchname
works fine for me with the latest version, so if you continue to see this problem I would recommend you recreate the workspace to try to get a clean repository.