-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luís Freitas
authored and
Luís Freitas
committed
Jun 30, 2024
1 parent
c5077bc
commit 140041c
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
print("hello") | ||
import os | ||
import git # type: ignore | ||
|
||
def clone_repo(repo_url, repo_path): | ||
if not os.path.exists(repo_path): | ||
git.Repo.clone_from(repo_url, repo_path) | ||
return git.Repo(repo_path) | ||
|
||
def main(): | ||
# Replace with your actual GitHub username | ||
repo_url = "[email protected]:lsfreitas/target.git" | ||
repo_path = "/tmp/target_repo" | ||
|
||
repo = clone_repo(repo_url, repo_path) | ||
print(f"Repository cloned to {repo_path}") | ||
|
||
if __name__ == "__main__": | ||
main() |