Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Commit failed - exit code 1 received" when trying to commit a new local reprository in gihub desktop

when I am trying to commit my new local repository at GitHub from GitHub-desktop it is throwing an error "Commit failed - exit code 1 received"

like image 552
Rahul Raj Avatar asked Apr 26 '18 21:04

Rahul Raj


People also ask

How do I commit to a GitHub issue?

To link a commit to a GitHub Issue, put the issue number with the # character in the Comment text box. For example, #111.

Why is my git commit not showing on GitHub?

Your local Git commit email isn't connected to your account Commits must be made with an email address that is connected to your account on GitHub.com, or the GitHub-provided noreply email address provided to you in your email settings, in order to appear on your contributions graph.

How do I reset a commit in GitHub?

Click History. Right-click the commit you want to revert and click Revert Changes in Commit.


1 Answers

Regarding:

https://cloud.githubusercontent.com/assets/1711576/26461047/58a465c6-4184-11e7-9ed4-baac5cde302e.png

Check first if you have added files to your index.
Open the command line and check your git status.

Second, see desktop/desktop issue 3701:

some users have run into this error due to having nested .git directories.
Can you try searching your repository to see if you have multiple .git directories?

Had a .git in my repository (which I needed) and a .git in a subfolder (which I deleted), then it worked.

Finally, check if you have any submodule (a .gitmodules file at the root of your repo).
See desktop/desktop issue 1770.

If I commit changes in submodule myself than GitHub Desktop is able to push and/or commit changes after that. After submodule is committed manually SHA1 changes from dirty. At this point I can commit to main repo.

like image 149
VonC Avatar answered Oct 05 '22 20:10

VonC