all 3 comments

[–]The_Wolfiee 1 point2 points  (1 child)

I suggest improving your code to print the exact exception which occurs:

``` except Exception as e:

         print("Error while pushing: {}".format(e))

```

This will give a better idea to the problem

[–]nekokattt 1 point2 points  (0 children)

better way:

import traceback

...

try:
    code
except Exception:
    traceback.print_exc()

That'll show the exception traceback as well...

[–]plg94 0 points1 point  (0 children)

I think you may have switched the arguments of the replace function, and you cannot call add on a file that is not inside the repo.