Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add STAGING PARTIAL CHANGES topic to documentation #107

Open
wants to merge 1 commit into from

3 participants

@rosenfeld

Please, take a look if you find these instructions could be useful for documenting better your last commit.

Thanks!

@tpope
Owner

I would like to expand the docs from being a terse reference to including more examples and workflows. Until that's done, though, I feel this commit would lure people away from the simpler workflows and into this advanced one. I'll hang onto it until the docs get some love.

@rosenfeld

Ok, no hurry :) Thanks for being worried about the docs. Great documentation is highly appreciated, although rare in lots of softwares out there :)

@blueyed blueyed commented on the diff
doc/fugitive.txt
@@ -260,6 +261,23 @@ a statusline, this one matches the default when 'ruler' is set:
>
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
<
+
+STAGING PARTIAL CHANGES
+
+With Git, you can select partial chunks of code to send to stage area with "git add -e"
+or "git add -p". See "git help add" for more information.
+
+With fugitive, you can accomplish the same in two different ways:
+
+1 - after :Gstatus, you can type "dp" in the line containing the file you want to filter
+chunks of changes.
+2 - you can just type ":Git! diff %" (or any other filename instead of '%', which means
+the file in current buffer).
@blueyed
blueyed added a note

This should probably also reference :Gdiff here, which is often more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 9, 2011
  1. @rosenfeld
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 1 deletion.
  1. +19 −1 doc/fugitive.txt
View
20 doc/fugitive.txt
@@ -44,7 +44,8 @@ that are part of Git repositories).
ca |Gcommit| --amend
D |:Gdiff|
ds |:Gsdiff|
- dp |:Git!| diff (p for patch; use :Gw to apply)
+ dp |:Git!| diff (p for patch; use :Gw to apply - See
+ STAGING PARTIAL CHANGES topic)
dp |:Git| add --intent-to-add (untracked files)
dv |:Gvdiff|
O |:Gtabedit|
@@ -260,6 +261,23 @@ a statusline, this one matches the default when 'ruler' is set:
>
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
<
+
+STAGING PARTIAL CHANGES
+
+With Git, you can select partial chunks of code to send to stage area with "git add -e"
+or "git add -p". See "git help add" for more information.
+
+With fugitive, you can accomplish the same in two different ways:
+
+1 - after :Gstatus, you can type "dp" in the line containing the file you want to filter
+chunks of changes.
+2 - you can just type ":Git! diff %" (or any other filename instead of '%', which means
+the file in current buffer).
@blueyed
blueyed added a note

This should probably also reference :Gdiff here, which is often more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+Then, you'll be presented with a diff view of that file. Replace '-' with space (' ') to
+lines you want to keep unchanged and delete the added lines (beginning with '+') you don't
+want to send to stage (just like stated in "git help add"). When you're set, just issue ":Gw".
+
ABOUT *fugitive-about*
Grab the latest version or report a bug on GitHub:
Something went wrong with that request. Please try again.