There's more...

As mentioned earlier, it's also possible to use git add -i to interactively add files. If we do this after resetting our branch, we will get the following menu:

$ git add -i
     staged     unstaged path
1:    unchanged      +37/-29 liberty.txt
    
*** Commands ***
1: status    2: update    3: revert    4: add untracked
5: patch     6: diff      7: quit      8: help
What now>

The eight options pretty much do what they say. We can choose the patch option to get into the patch menu, as we saw previously, but first we have to choose which files to add patches for:

What now> p
          staged     unstaged path
1:    unchanged      +37/-29 liberty.txt
Patch update>> 1
         staged     unstaged path
* 1:    unchanged      +37/-29 liberty.txt
Patch update>>
diff --git a/liberty.txt b/liberty.txt
index 8350a2c..9638930 100644
--- a/liberty.txt
+++ b/liberty.txt
...

Once we have chosen the files, we want to add patches so they get a * character in the menu. To begin patching, just click on <return>. When you're done, you'll return to the menu and can quit, review, revert, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.35.81