I am trying to add part of a commit using
git add -p
I chose the regex option
/ - search for a hunk matching the given regex
The patch contains these lines
+ AMFObject obj2;
+ AMFObjectProperty p;
+ AVal redirect;
But git doesn't seem to find it
search for regex? redirect
No hunk matches the given pattern
The git add command adds new or changed files in your working directory to the Git staging area. git add is an important command - without it, no git commit would ever do anything. Sometimes, git add can have a reputation for being an unnecessary step in development.
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.
To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.
Git facilitates us with a unique option of the add command by which we can add all the available files at once. To add all the files from the repository, run the add command with -A option. We can use '. ' Instead of -A option.
The issue was that this patch affected more than one file.
I needed to chose
d - do not stage this hunk nor any of the later hunks in the file
until reaching correct file, then regex will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With