I've made a simple script to commit files to git. There is a lot of output of commands git pull and git push. So, how do I output only the last line of the git command. I tried variations of git pull | tail -1 and grep, but can not figure it out.
I want git pull to only output the last line usually something like:
- X files changed, XXX insertions(+), XXX deletions(-)
- Already up-to-date.
or when using git push only
- 45604564 master -> master
I also wonder, how do I output only third line from last line?