I forgot to git pull
my code before editing it; when I committed the new code and tried to push, I got the error "push is not possible".
At tha
Since git 2.23 (August 2019) you now have a shortcut to do that: git restore --staged [filepath]
.
With this command, you could ignore a conflicted file without needing to add and remove that.
Example:
> git status
...
Unmerged paths:
(use "git add ..." to mark resolution)
both modified: file.ex
> git restore --staged file.ex
> git status
...
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: file.ex