I am trying to understand why the Euler-Mascheroni constant $\displaystyle \gamma = \lim_{n \rightarrow \infty} \left ( \sum_{k=1}^n \frac{1}{k} - \ln n \right )$ is equal to $1 - \displaystyle \int_{1}^{\infty} \frac{t-[t]}{t^2}\; \mathrm{d}t$ where $[t]$ is the floor function.
There has been an answered question here already:
Integral form for the euler-mascheroni gamma constant using floor function
However, there is one line I do not understand and will appreciate help on explaining why the following equality is true: $$ \lim_{m\rightarrow \infty} \sum_{n=1}^{m} (\ln (1 + \frac{1}{n})-\frac{1}{n+1})= 1 - \gamma $$
Note that
$$\ln \left(1+\frac{1}{n}\right) = \ln \frac{n+1}{n} = \ln (n+1) - \ln n.$$
Hence
$$\begin{align} \sum_{n=1}^m \left(\ln \left(1+\frac{1}{n}\right) - \frac{1}{n+1}\right) &= \sum_{n=1}^m (\ln (n+1) - \ln n) - \sum_{n=1}^m \frac{1}{n+1}\\ &= \underbrace{\ln (m+1) - \sum_{k=1}^{m+1} \frac{1}{k}}_{\to -\gamma} + 1. \end{align}$$