I have a repo having multiple branches. I am able to access all branches in my local through gitpython. However the same code i used to create gitpython's git.Repo() to create repo object but repo.branches showing only master [] though i can check manually in jenkins/workspace terminal the repo having all the branches. Can anyone help me in understanding What could be the issue?
from git import Repo
clone_my_repo("myrepo") #my function to clone the repo working fine both locally and through jenkins
module = Repo("myrepo")
print(module.branches)
[<git.Head "refs/heads/master">]