I don’t see an option to checkout or list remote/local branches in this module: https://gitpython.readthedocs.io/en/stable/
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After you’ve done
(and possibly some other command to init
gto the repository you care about) all attribute requests ongare more or less transformed into a call ofgit attr *args.Therefore:
should do what you want.
will list the branches. However, note that these are very low level commands and they will return the exact code that the git executables will return. Therefore, don’t expect a nice list. I’ll just be a string of several lines and with one line having an asterisk as the first character.
There might be some better way to do this in the library. In
repo.pyfor example is a specialactive_branchcommand. You’ll have to go through the source a little and look for yourself.