0

I've been running into some issues trying to make an initial commit to a local repository. All the files I'm trying to push were generated by a script used to break down Roblox place files (.rbxlx) into multiple .lua files used by the Rojo development tool for version control & more. If it's helpful, it can be found here: https://github.com/rojo-rbx/rbxlx-to-rojo

I suspect that the issue may be related to the conversion, but the script did not generate any errors and all of the resulting files look exactly as they should and exactly as they did before being processed.


I've tried:

  • Updating Git (this made the error message more specific)
  • Ensuring all of my files were UTF-8 (they are)
  • Adding .DS_Store to .gitignore (there are some invalid characters here, but they're not being staged.)
  • Resetting/reinitializing the repository
  • Making the commit via VSCode as I usually do
  • Simply initializing & making the commit via Terminal on macOS

Command & output in Terminal:

git commit --message "Initial commit"

error: stream did not contain valid UTF-8

fatal: failed to write commit object

Command & output via VSCode (Commit & Push option)

2023-07-01 14:27:43.239 [info] > git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - [32ms]
2023-07-01 14:27:43.240 [info] error: stream did not contain valid UTF-8

fatal: failed to write commit object
2023-07-01 14:27:43.250 [info] > git config --get-all user.name [8ms]
2023-07-01 14:27:43.259 [info] > git config --get-all user.email [7ms]
2023-07-01 14:27:43.269 [info] > git config --get commit.template [7ms]
2023-07-01 14:27:43.271 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [7ms]
2023-07-01 14:27:43.282 [info] > git status -z -uall [9ms]
2023-07-01 14:27:44.416 [info] > git config --get commit.template [8ms]
2023-07-01 14:27:44.421 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [12ms]
2023-07-01 14:27:44.434 [info] > git status -z -uall [10ms]
  • Welcome to SO! `commit` vs `push`? I think we need more clarity _and_ having the actual command and its output in the question would go a long way. – eftshift0 Jul 01 '23 at 20:40
  • Hi @eftshift0, and thank you. I've edited my question to include some addtl. information - hopefully it's of some use. – jadenbryant Jul 01 '23 at 21:34
  • I have no idea what that is.... I wonder it you have a commit hook that is producing that. – eftshift0 Jul 01 '23 at 21:36
  • First error line doesn't look like it's in git code... however, the _second_ line is. Looks relevant: https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0 – eftshift0 Jul 01 '23 at 21:41
  • If that is not the problem, Running with `GIT_TRACE=1` might help us figure out what is going on. – eftshift0 Jul 01 '23 at 21:43
  • Thanks for your help! `GIT_TRACE=1` showed me that the issue was related to some GPG program and disabling it solved my problem. How should I go about closing this question? @eftshift0 – jadenbryant Jul 01 '23 at 22:15
  • Let me mark it as a duplicate. – eftshift0 Jul 02 '23 at 06:01

0 Answers0