I am trying to modify my git remote repo address and I got confused over pipe (|
).
What is the difference between the two and why the first option doesn't work?
# Doesn't work
git remote get-url origin | sed 's/old/new/' | git remote set-url origin
Works
git remote set-url origin $(git remote get-url origin | sed 's/old/new/')