I'm trying to push a new git repo upstream using gitpython module. Below are the steps that I'm doing and get an error 128.
# Initialize a local git repo
init_repo = Repo.init(gitlocalrepodir+"%s" %(gitinitrepo))
# Add a file to this new local git repo
init_repo.index.add([filename])
# Initial commit
init_repo.index.commit('Initial Commit - %s' %(timestr))
# Create remote
init_repo.create_remote('origin', giturl+gitinitrepo+'.git')
# Push upstream (Origin)
init_repo.remotes.origin.push()
While executing the push(), gitpython throws an exception:
'git push --porcelain origin' returned with exit code 128
Access to github is via SSH.
Do you see anything wrong that I'm doing?