Result:
\nrepo.git.execute(f\"git commit -m 'word1 word2'\")\nTraceback (most recent call last):\n File \"E:\\Program Files\\JetBrains\\PyCharm 2021.2.2\\plugins\\python\\helpers\\pydev\\_pydevd_bundle\\pydevd_exec2.py\", line 3, in Exec\n exec(exp, global_vars, local_vars)\n File \"<input>\", line 1, in <module>\n File \"<homefolder>\\Repository\\iac\\infra-netbox-updates\\update-vlans-from-imc\\venv\\lib\\site-packages\\git\\cmd.py\", line 928, in execute\n raise GitCommandError(redacted_command, status, stderr_value, stdout_value)\ngit.exc.GitCommandError: Cmd('g') failed due to: exit code(1)\n cmdline: g i t c o m m i t - m ' w o r d 1 w o r d 2 '\n stderr: 'error: pathspec 'word2'' did not match any file(s) known to git'\n
without the space it works
\nrepo.git.execute(f\"git commit -m 'word1_word2'\")\n\"[master 0dd6731] 'word1_word2'\\n 12 files changed, 6533 insertions(+)\\n create mode 100644 newfile.txt\n\n<information redacted>\n...\n
I tried to use
\nrepo.commit('master')
\nand it works also , but i am clueless on how to place a message in this wrappers ..
Despite the name, execute()
(instead of _execute()
is a low-level method that shouldn't be used.
Turn…
\nrepo.git.execute(f\"git add {origin}*\")
into repo.git.add(f\"{origin}*\")
repo.git.execute(f\"git commit -m 'word1 word2'\")
into repo.git.commit(m='word1 word2')
…and things should work as expected.
\nMore about how to call git directly is in the docs.
","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1379#discussioncomment-1697158"}}}-
when using git execute to send a comment in the commit message i am getting an error that seems to be a buggy behavior where a space is not accepted I am using python v3.10 with GitPython==3.1.18 Example code:
Result:
without the space it works
I tried to use |
Beta Was this translation helpful? Give feedback.
-
Despite the name, Turn…
…and things should work as expected. More about how to call git directly is in the docs. |
Beta Was this translation helpful? Give feedback.
Despite the name,
execute()
(instead of_execute()
is a low-level method that shouldn't be used.Turn…
repo.git.execute(f"git add {origin}*")
intorepo.git.add(f"{origin}*")
repo.git.execute(f"git commit -m 'word1 word2'")
intorepo.git.commit(m='word1 word2')
…and things should work as expected.
More about how to call git directly is in the docs.