1

Since im making my forks called as folders im using them then for fast push wanted to make command

git commit -a && git push origin printf '%s\n' "${PWD##*/}" && git fetch --all

Somehow its not working. How to make any command in command?

2 Answers 2

3
git push origin printf '%s\n' "${PWD##*/}"

That printf is going to be taken literally by the command. It needs to be run before the git statement. You can do this by either setting it to a variable beforehand (or more commonly) wrapping it:

git push origin $(printf '%s\n' "${PWD##*/}")
1

You can use basename as,

git push origin $(basename ${PWD})

or,

git push origin `basename ${PWD}`

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .