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] Wed, 25 May 2011 22:13 Go to next message
Lawrence Mandel is currently offline Lawrence Mandel
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?



Re: How do I commit a staged file [message #674428 is a reply to message #674172] Thu, 26 May 2011 17:34 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 556
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] ?

Previous Topic:Error in compare editor
Next Topic:Status of working tree in Repository view
Goto Forum:

Current Time: Fri Aug 22 06:06:04 EDT 2014

Powered by FUDForum. Page generated in 0.03239 seconds