LaonA2_VL_3B / git_helper.py
gykim
Add git_helper.py
8a8ed61
#!/usr/bin/env python3
import subprocess
import os
def run_git_command(command):
"""git ๋ช…๋ น์„ ์‹คํ–‰ํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅ"""
try:
result = subprocess.run(command, shell=True, capture_output=True, text=True, cwd=".")
print(f"Command: {command}")
print(f"Exit code: {result.returncode}")
if result.stdout:
print(f"Output:\n{result.stdout}")
if result.stderr:
print(f"Error:\n{result.stderr}")
print("-" * 50)
return result.returncode == 0
except Exception as e:
print(f"Error running command: {e}")
return False
if __name__ == "__main__":
# Git ์ž‘์—… ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰
commands = [
"git add .",
"git commit -m 'Initial commit: LaonA2 VL 3B model'",
"git remote -v",
"git push -u origin main --force"
]
for cmd in commands:
print(f"\n๐Ÿ”„ Executing: {cmd}")
success = run_git_command(cmd)
if not success and "push" in cmd:
print("Push failed, continuing...")
elif not success and "commit" in cmd:
print("Commit may have failed due to no changes, continuing...")