| from huggingface_hub import Repository | |
| # Clone and link to local repo (or use a temp dir) | |
| repo = Repository(local_dir="GabriIT", clone_from="GabriIT/basics") | |
| # Make changes to a file | |
| with open("GabriIT/basics/app.py", "a") as f: | |
| f.write("\nprint('Updated code!')\n") | |
| # Stage, commit, push | |
| repo.git_add(["app.py", "travel_time.py", "README.md", "requirements.txt", "README.md", "READMEexplain.md", "commitHF.py"]) | |
| repo.git_commit("app for basics about HF") | |
| repo.git_push() | |
| # Note: Ensure you have the correct permissions to push to the repository. |