kphtha
Last Updated: February 25, 2016
·
782
· bartekfi

Add chunk(s) of modified file to a commit interactively

git

Use git add -p *filename* or git add --patch *filename* to interactively pick which parts of modified file should be added to a commit.

The pick dialog looks like this:

@@ -24,7 +32,12 @@ module CoreMIDI
]

   functions.each do |func|
-    attach_function *func
+    begin
+      attach_function *func
+    rescue Exception => e
+      $stderr.puts "Couldn't attach function #{func.first}"
+      raise
+    end
   end

   def midi_read_proc()
Stage this hunk [y/n/a/d/K/j/J/e/?]?

more info: http://nuclearsquid.com/writings/git-add/

Say Thanks
Respond

1 Response
Add your response

1888
Photo on 08.01.2013 at 04.15

Nice, but for such things I prefer gui.

over 1 year ago ·
Filed Under