0

Someone told me to use git add --patch but can't seem to distinguish the difference between that and git add -p that I used before.

  • Whats the difference between git add -p and git add --patch ?
Brainmaniac
  • 2,115
  • 2
  • 22
  • 43

1 Answers1

4

There is no difference at all. -p is a shorthand for --patch: https://git-scm.com/docs/git-add#Documentation/git-add.txt--p

-p

--patch

Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.

This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See “Interactive mode” for details.

Community
  • 1
  • 1
1615903
  • 28,988
  • 11
  • 62
  • 87