0

I'm trying to add, push and commit using gitpython, to push everything in "C:\users\Blah Blah Blah.git" to my bitbucket acct.

Below is my code:

from git import Repo,remote
PATH_OF_GIT_REPO = r'C:\\users\\Blah Blah Blah' 
COMMIT_MESSAGE = 'comment from python script'

repo = Repo(PATH_OF_GIT_REPO)
repo.git.add(update=True)
repo.index.commit(COMMIT_MESSAGE)
origin = repo.remote(name='origin')
origin.push()

Nothing seems to be happening, and I don't get any error messages neither. I'd appreciate any kind of help :)

Inigo
  • 12,186
  • 5
  • 41
  • 70
mmk
  • 1
  • 2
  • What did you expect to be committed? Maybe there are no changes? – mkrieger1 May 08 '20 at 17:47
  • Oh, well I was expecting to have everything in my repo path added. Doesn't add(update=True) look for chages? I added a new file to the folder and I want it to be added to my bitbucket. So, there definitely are changes, because I don't see the file added. – mmk May 08 '20 at 17:55
  • Possible duplicate of [What is the difference between “git add -A” and “git add --update :/”?](https://stackoverflow.com/questions/28146646/what-is-the-difference-between-git-add-a-and-git-add-update). I suppose `repo.git.add(update=True)` is equivalent to `git add --update`, which does not add untracked files. – mkrieger1 May 08 '20 at 18:14

0 Answers0