Craft a commit (hunks, commit only staged changes) ? [message #526469] |
Sun, 11 April 2010 11:10  |
Eclipse User |
|
|
|
Hello
I figured out how to stage all changes of a file in the commit dialog
(and then pressing cancel), and if the file gets changes afterwards,
it gets decorated accordingly. However, how can I now commit just the
staged changes - not all changes?
What EGit IMHO does right now is:
# commit all changes of the file
$ git commit -a
I am looking for the EGit equivalents of the following git commands:
# commit only staged changes
$ git commit
# unstage a file
$ git reset HEAD
# only stage some hunks of the changes of the file
$ git add -i
The following additional questions are all related to staging/
committing:
- How can I edit the hunks of a change?
- How can I diff the staged changes vs repo ($ git diff --cached)?
- How can I diff an entire project, not just a single file (context menu
always disbaled when diff is done on a project/package) ($ git diff)?
Thanks
Michael
|
|
|
|
|
Re: Craft a commit (hunks, commit only staged changes) ? [message #579363 is a reply to message #526469] |
Tue, 13 April 2010 06:46  |
Eclipse User |
|
|
|
Hi Michael,
everything you mention are features that should be added to EGit but are not
there yet. In particular the Git index support was not very much in focus so
far.
We track and discuss future changes and enhancement requests in the eclipse
bugzilla. You are very welcome to file bugs there for missing features.
"Michael Pellaton" <groups@pellaton.li> wrote in message
news:hpsool$of4$1@build.eclipse.org...
> Hello
>
> What EGit IMHO does right now is:
> # commit all changes of the file
> $ git commit -a
You're right, this is what EGit currently does.
> I am looking for the EGit equivalents of the following git commands:
> # commit only staged changes
> $ git commit
I think there should be a commit dialog similar to git gui with two
different lists: the working tree changes and the staged changes.
Per default only the staged changes should be commited.
> # unstage a file
> $ git reset HEAD
Yes, that's really needed, but first it should be possible to commit the
staged changes. Otherwise there is no usecase in EGit to unstage files.
> # only stage some hunks of the changes of the file
> $ git add -i
Yes, of course, but more advanced.
> The following additional questions are all related to staging/
> committing:
> - How can I edit the hunks of a change?
Not yet.
> - How can I diff the staged changes vs repo ($ git diff --cached)?
This will be needed when it is possible to commit only the staged changes.
> - How can I diff an entire project, not just a single file (context menu
> always disbaled when diff is done on a project/package) ($ git diff)?
This is also not implemented yet.
Thanks for your help!
Stefan
|
|
|
|
Powered by
FUDForum. Page generated in 0.04151 seconds