I want to create a python script for making local repository and I have no idea how to do this, after local repository I want to do cherry-pick for specific commit. Any tips for me ?
Asked
Active
Viewed 868 times
1 Answers
1
Refer to below for what we have used to create a repo and some actions in Python:
Create repo
repo = git.Repo(os.path.abspath(repo_path))
Do checkout
repo.git.checkout(branch)
repo.git.checkout(commit_hash)
repo.git.checkout(tag_name)
Do cherry-pick commit hash 'fff1234'
repo.git.cherry_pick('fff1234')
You can refer to this URL for more details https://titanwolf.org/Network/Articles/Article?AID=0f484197-1dc3-4676-82c8-5359fad01f33#gsc.tab=0

Ngoc Hoang Nguyen
- 19
- 3