Warning: this question is not about usage of git, but about usage of pipes in Linux, git command is given here as example.
Having such output of git push
fatal: The current branch my_branch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin my_branch
I want to execute given command, i.e. git push --set-upstream origin my_branch.
By doing git push 2>&1 | tail -3 I get git push --set-upstream origin my_branch printed on screen.
Question: What command should be added to next pipe so given git push will be executed. So I could do git push 2>&1 | tail -3 | command_to_eval_given_string
tail -1, nottail -3... it's just the last one line.