I am facing problems when trying to add a specific filename to a commit. I can get it working via --all or u=True etc. but when I state the specific name within the command, it gives me the following error:
raise GitCommandError(command, status, stderr_value, stdout_value) git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git add stderr: 'fatal: pathspec '' did not match any files'
When I copy out and paste the cmd line and paste it into git bash however, it works fine. Is this a functionality problem?
Code below:
repo.git.checkout('master')
repo.git.pull
repo.git.checkout('Test_20191102c')
repo.git.add(u=False,'Database/Tables/dbo.daletesttable.sql')
repo.git.add('Database/Tables/dbo.daletesttable.sql')
repo.git.commit('-m', 'test automation git python 001')
repo.git.push('--set', '-upstream', 'origin', 'Test_20191102c')
Full stacktrace:
Repo at C:\sdw successfully loaded.
Traceback (most recent call last):
File "C:/%hiddenpath%/dev2test.py", line 158, in repo.git.add('SDW/Database/Tables/dbo.daletesttable.sql')
File "C:/%hiddenpath%\cmd.py", line 551, in return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:/%hiddenpath%\cmd.py", line 1010, in _call_process return self.execute(call, **exec_kwargs)
File "C:/%hiddenpath%\cmd.py", line 821, in execute raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git add Database/Tables/dbo.daletesttable.sql
stderr: 'fatal: pathspec 'Database/Tables/dbo.daletesttable.sql' did not match any files'