-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpushHTML.py
More file actions
27 lines (24 loc) · 743 Bytes
/
Copy pathpushHTML.py
File metadata and controls
27 lines (24 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding=utf8
## This file will create a function that wiil upload the new index to GitHub when called
## Using GitPython
### DEFINE FUNCTION:
def push():
from git import Repo
path = "/Users/parulagarwal/Documents/Code/GitHub/Pantone_ColorOfTheDay"
try:
repo = Repo(path)
file_list = [
"index.html",
"Colors.csv"
]
commit_message = 'Add new color'
#repo.git.add(update=True)
repo.index.add(file_list)
repo.index.commit(commit_message)
origin = repo.remote(name='origin')
origin.push()
print('Code push from script succeeded')
except:
print('Some error occured while pushing the code')
## RUN FUNCTION:
#push()