Invalid variable name in Bash from Git alias
I have the following Git alias in my global Git config.
pushnew = !f() { export tmp_branch=`git branch | grep '* ' | tr -d '* '` && git push --set-upstream origin $tmp_branch; unset $tmp_branch; }; f
When running, I get the following output:
* [new branch] bug/graphs -> bug/graphs
Branch bug/graphs set up to track remote branch bug/graphs from origin.
f() { export tmp_branch=`git branch | grep '* ' | tr -d '* '` && git push --set-upstream origin $tmp_branch; unset $tmp_branch; }; f: 1: unset: bug/graphs: bad variable name
I saw this question , but if this is a solution, then how to apply the fix in the context of a Git alias?
+3
source to share