Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » How do I commit a staged file
How do I commit a staged file [message #674172] Thu, 26 May 2011 02:13 Go to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
I have a file that is decorated with the staged icon (as shown at [1]). I have two questions about this state:

1. How does a file get into this state? Note that I first saw the icon on the file after committing a number of files, the rest of which do not have this icon.
2. I have tried committing this file and clicking on various other options on the Team menu but cannot get the file into the committed state where no staged decoration (icon) shows. Can anyone tell me what to do get this file into the correct state?

[1]http://wiki.eclipse.org/EGit/User_Guide/State

Thanks!

Lawrence
Re: How do I commit a staged file [message #674428 is a reply to message #674172] Thu, 26 May 2011 21:34 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
1. files get stage through Team > Git > Add action, this puts a snapshot of the file content into git's object database but does not yet create a commit object and also doesn't move the HEAD. This means "Add" is preparing commit. Also as the added content snapshot is copied to the git object database you can revert your working tree back to that state (using reset) in case additional changes you did after adding turned out to be wrong.
2. currently the EGit commit dialog doesn't care if you added files or not, instead it always displays all modifications. All files marked with the checkbox will be comitted. This behavior is more similar to how e.g. SVN handles commit. The newly upcoming staging view will provide commit of staged changes (this is the default in native git).

Did you go through the EGit basic tutorial [1] ?

[1] http://wiki.eclipse.org/EGit/User_Guide#Basic_Tutorial:_Adding_a_project_to_version_control
Previous Topic:Error in compare editor
Next Topic:Status of working tree in Repository view
Goto Forum:
  


Current Time: Mon Nov 24 09:27:24 GMT 2014

Powered by FUDForum. Page generated in 0.02303 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software