July 2018
Intermediate to advanced
354 pages
10h 57m
English
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 ...Read now
Unlock full access