commit not working

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

commit not working

Juan
Hi All

I have the problem that my project shows an error message when I try to commit it. The project appears in the navigator with the message "NO-HEAD" next to the name.

The error when I try to commit is the following:

An internal error occurred during: "Committing changes".
Exception caught during execution of add command

I appreciate any help.

Best
Juan
Reply | Threaded
Open this post in threaded view
|

Re: commit not working

Bio7
Administrator
Hello Juan,

this is a Git (EGit question) to commit to a remote repository (Github). The message means that there is no branch to commit to, see:

https://stackoverflow.com/questions/14896533/git-no-head-statement

But I think you can select the head when using the context menu (on the folder!):

Team->Remote->Push

Press 'Next'

Press 'Add All Branches Spec' (or select and add the source Head and destination Head)

Press 'Finish'


See also:

https://wiki.eclipse.org/EGit/User_Guide/Remote


https://wiki.eclipse.org/EGit/User_Guide

Forum:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=48
Reply | Threaded
Open this post in threaded view
|

Re: commit not working

Juan
Dear Bio7, thanks for your quick reply

Here are some tests I made

1
When I first go to the context menu and select "Team -> Share Project"
I get the following warning message:
"The environment variable HOME is not set. The following directory will be used for storing the Git user configuration and as default repository location: C:\Users\Juan Prada. If this is not correct please set the HOME environment variable and restart Eclipse."    
I checked and the directory was created so I thought it does not matter but could it be it does matter?

2
If I simply proceed here then the push option is not available I got to "Team -> Remote -> ..." the "Push" option is not available.

3
If I commit the project I get and error, it says "Exception caught during execution of add command" and the same happens if I try to do the add before committing.

Thanks again for your help.

PS: I found no help in the Eclipse forum



 
Reply | Threaded
Open this post in threaded view
|

Re: commit not working

Bio7
Administrator
This post was updated on .
Hello Juan,

it seems that you don't have a local GIT repository configured. In (1) Eclipse searches or want to create a local GIT repo which you can share and sync with the remote (Github, etc.) repo.

That's why you can't share your local Eclipse repo (2) or commit (3)

Have you already configured a local GIT repository on your computer (it should be on you computer and be found under something like "C:\Users\Juan.... " - as you already described EGit want to create a default local repo)?

If you have already a local GIT repo on your computer first import it (e.g. if you have only updated Bio7
and worked with Git before on the same computer!)

Import Projects from Git->Exisitng Local Repository

then add your existing local Git repo. Select and import it as an Eclipse project (Import Existing Eclipse Projects). Now you should have your existing  Git repo configured in a new installation.

You can also open and use the Git perspective to add an existing local Git repo with the "Git Reposities" view (see the toolbar actions!)

A newly created remote Github repo (e.g. Github) can be imported, too and then the new local project can be shared with that newly created remote repository.

Here another EGit tutorial:

https://eclipsesource.com/de/blogs/tutorials/egit-tutorial/


In additon:

If you have a new computer and you have problems with your Java classpath (red exclamation mark) recalculate the classpath (after syncing a remote repo with pull)

The new EGit dialog has a commit and push function which instantly commits and pushes the staged files to the remote repo.


Reply | Threaded
Open this post in threaded view
|

Re: commit not working

Bio7
Administrator
The issue was solved by setting the HOME variable to a writable public folder on Windows 10.

If the HOME variable is not set (normally a dialog warns if not deactivated) egit picks a default user folder
which is ok if writable.

The default user folder in this case was not writable.