Git resource local branch


#1

Sorry, but despite the doc: https://docs.chef.io/resource_git.html
and searching, I still struggling to display local branch correctly
Using git - it’s always the deploy branch name.
But I want it to be the tag/branch im currently using.

Thanks in advance!


#2

Holypan-

Can you be a little more specifc in what you’re trying to do and the steps you’re taking to get there?

It sounds like you need to ‘git checkout nameofyourlocalbranch’ and you should be on your local branch. I think some more details will help out the userbase here in determining what your problem is.

Thanks


#3

Hi,

Yep, I want to do git checkout provision_type with chef
And it should fetch changes from repo if they are there
And locally, git status should return correct value, not the deploy branch

Something like: git clone; git checkout revision => next run: git pull

Because, I have tried properties: revision, checkout_branch, enable_checkout. And still cannot make it work as needed.

As far as I understand from chef code, there is no such possibility to do so?
Even, considering the issue: https://github.com/chef/chef/issues/1984