Govur University Logo
--> --> --> -->
...

What Git command allows you to add only *specific linesfrom a modified file to the staging area, leaving other changes in the working directory?



The Git command that allows you to add only specific lines from a modified file to the staging area, leaving other changes in the working directory, is `git add -p` or its long form, `git add --patch`. When you execute `git add -p`, Git enters an interactive mode. It scans all modified files in your working directory. The working directory refers to the actual files on your file system that you are currently editing. Git then identifies all changes in these files by comparing them against the version currently in the staging area (or the last commit if the file is not yet staged). It breaks down these changes into discrete, contiguous blocks called 'hunks'. A hunk is a logical group of added, deleted, or modifi....

Log in to view the answer



Redundant Elements