I’m quite new to using NetBeans and today I faced a problem. I have used to stage only part of files to make better commits.
I have used vim and fugitive plug-in, where I can just move specific lines from unstaged to staged.
I can do a workaround by calling git add -p, but it would be nice to do it straight from NetBeans IDE.
Is there a mysterious way to do it simple by clicking somewhere and stage specific line(s)?
Using
git add -pis not a workaround but the way to do it.If you need it more comfortable, fire up
git guias External Tool out of NetBeans and use it to stage lines manually.Regardless if you get that working somehow or not: this is exactly the reason why I advocate using one tool for one task and not trying to do everything in one.
In Does netbeans ignore my git pre-commit hook?, I discussed that the Git implementation of NetBeans is far from being complete.
git add -pdoes not seem being contained in the NetBeans Git integration plan.NetBeans is using
jgit.jgitdoes not provide means to stage parts of files, there’s only theAddCommandthat providesaddFilepattern(). So the answer to your question is no, it won’t work.