You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import git
|
|
|
|
|
|
|
|
commit_hash = "a361cc1"
|
|
|
|
|
|
|
|
repo = git.Repo('.')
|
|
|
|
|
|
|
|
if repo.is_dirty():
|
|
|
|
repo.git.stash()
|
|
|
|
|
|
|
|
repo.git.update_ref("refs/remotes/origin/main", commit_hash)
|
|
|
|
repo.remotes.origin.fetch()
|
|
|
|
repo.git.pull("origin", "main")
|