written small snippet to automate git add , commit and push using pythongit.
def git_commit_push(self):
repoDir = self.backupRepositoryPath
repo = git.Repo( repoDir )
print repo.git.status()
repo.git.add('--all')
print repo.git.status()
repo.git.commit( m='pusing for backup' )
repo.git.push()
print repo.git.status()
Need to add below mentioned check points
1: Before commit , check any files are modified. If no files then skip commit
2: Before push , check any committed files to be pushed. If no files then skip push
Please help writing the if condition for these two check points.
Regards, Prasad