Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "+1/-1" mean on git's output?

Tags:

git

If I try to interactively add a file to git,

git add -i

I get this output:

*** Commands ***
  1: [s]tatus     2: [u]pdate     3: [r]evert     4: [a]dd untracked
  5: [p]atch      6: [d]iff   7: [q]uit   8: [h]elp
What now> 1
           staged     unstaged path
  1:    unchanged        +1/-1 index.html

I'm assuming this +1/-1 means that there's one unstagged file, but why the +1/-1? What doe sit mean? Why not just 1?

like image 985
cfischer Avatar asked Dec 04 '22 09:12

cfischer


2 Answers

This is indicating that index.html has had one line removed, and one line added. This is typical for Git when you change a part of a line.

like image 189
Ryan Bigg Avatar answered Dec 23 '22 14:12

Ryan Bigg


It is telling you how many lines are added/deleted. +1/-1 likely means you modified a single line.

like image 41
John Zwinck Avatar answered Dec 23 '22 14:12

John Zwinck