#!/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...")