So one thing that happens to every now and then, is:
git merge <some-branch>
I want to ask about is this last step. I know I can do a git add .
, but I may have some loose files laying around that I do not want added to version control.
Is there a command, alias, or some way you know to only add the previously conflicting files?
To fix the conflict, you can follow the standard procedures for resolving merge conflicts from the command line. When you're finished, you'll need to call git rebase --continue in order for Git to continue processing the rest of the rebase.
If you have some files that you don’t want added, but don’t have any such non-conflicting changes, then you can use git add --update
:
git add -u .
From git-add(1)
:
-u
,--update
Update the index just where it already has an entry matching
<pathspec>
. This removes as well as modifies index entries to match the working tree, but adds no new files.If no
<pathspec>
is given when-u
option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
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