pull.py文件 #7
Loading…
Reference in New Issue
No description provided.
Delete Branch "markino/PRWelBot4SECourse:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#!/usr/bin/env python3
import os
import subprocess
def pull(remote_url, local_path):
"""从远程仓库拉取代码到本地路径"""
command = f"git -C {local_path} pull {remote_url}"
process = subprocess.run(command, shell=True, check=True)
if process.returncode != 0:
print(f"拉取失败: {process.stderr}")
return False
print(f"拉取成功!")
return True
def main():
# 设置远程仓库 URL 和本地路径
remote_url = "your_remote_url"
local_path = "/path/to/local/repo"
if name == "main":
main()
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.