Last active
April 29, 2022 10:16
-
-
Save yoursamlan/08ce7b63ce2c8f894c2583281fd40f9b to your computer and use it in GitHub Desktop.
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
import datetime,time | |
from git import Repo | |
from tqdm import tqdm | |
PATH_OF_GIT_REPO = r'C:\Users\path\to\git\dir\.git' # make sure .git folder is properly configured | |
def git_push(): | |
try: | |
repo = Repo(PATH_OF_GIT_REPO) | |
repo.git.add(update=True) | |
repo.index.commit(COMMIT_MESSAGE) | |
origin = repo.remote(name='origin') | |
origin.push() | |
#print(COMMIT_MESSAGE) | |
except: | |
print('Some error occured while pushing the code') | |
while True: | |
t = datetime.datetime.now() | |
COMMIT_MESSAGE = 'Last updated at '+ str(t) | |
git_push() | |
for _ in tqdm(range(30),desc=COMMIT_MESSAGE): | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment