What does "+ 1 / -1" mean in git output?

If I try to add a file in git interactively,

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 assume that this is + 1 / -1 means there is one unmarked file, but why is + 1 / -1? What does it mean? Why not only 1?

+4
source share
3 answers

This indicates that index.html deleted one line and added one line. This is typical of Git when changing part of a string.

+10
source

Tells you how many rows are added / deleted. +1/-1 probably changed one line.

+5
source

This is the commit status. and an overview of attachments and exceptions for repos in this commit. set the stat or shortstat flag to git log to view them for all your previous commits.

git log --stat

+1
source

Source: https://habr.com/ru/post/1495306/


All Articles