I am using puppet to clone a repo on an agent node. My site.pp contains
node foobar{
vcsrepo{"home/user1/gitrepo1":
provider=>git,
source=>"https://github.com/foobar/foo.git",
revision => "remotes/origin/bar",
}
}
On the agent when I do git branch
after the catalog has been applied, it shows
*(no branch)
master
When I do git branch -a
it shows
master
remotes/origin/HEAD -> origin/master
remotes/origin/bar
I want to be able to checkout the remote "bar" branch. Only specifying the revision=>bar
gives the following error. The documentation is not too clear on this either.
err: /Stage[main]//Node[foobar]/Vcsrepo[/home/user1/gitrepo1]: Could not evaluate: Execution of '/usr/bin/git rev-parse bar' returned 128: fatal: ambiguous argument 'bar': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
bar
EDIT: There was a typo in what I had initially posted. I had in fact specified revision=>bar in my site.pp
Thank you.