簡體   English   中英

Python 本地存儲庫腳本和特定提交的 Cherry-Pick GIT

[英]Python Script for Local Repository and Cherry-Pick for specific commit GIT

我想創建一個 python 腳本來制作本地存儲庫,但我不知道如何執行此操作,在本地存儲庫之后我想為特定提交進行櫻桃挑選。 對我有什么建議嗎?

請參閱下文,了解我們用於在 Python 中創建存儲庫的內容和一些操作:

創建倉庫

repo = git.Repo(os.path.abspath(repo_path))

結帳

repo.git.checkout(branch)
repo.git.checkout(commit_hash)
repo.git.checkout(tag_name)

做櫻桃挑選提交 hash 'fff1234'

repo.git.cherry_pick('fff1234')

您可以參考這篇URL了解更多詳情

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM