0

I would like to create a new reference that is not a tag nor a branch, in the same way git update-ref would:

git update-ref refs/pull/201/head ac8d616ea3598e49935908e5685e72038a37cd8f

How can I do that with GitPython ? I found TagReference.create to create a tag and I probably need a similar.

1 Answer 1

3

Contrary to tags or branch creation, there is no GitPython wrapper. Instead the git update-ref should be used via the GitCmd generic wrapper like so:

import git
r = git.Repo('.')
r.git.update_ref('foobar', '8d5f33071777bb59bb45adae178fa1fb69101e68')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.