I have these functions in my .bash_profile on ubuntu server instance on google cloud for pull and push the git branch
plb(){
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
git pull origin $branch
}
psb(){
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
git push origin $branch
}
if i run the code line individually then the work properly but when i try to put it in a function it shows the following error
$ plb
: command not found
: command not found
what am i doing wrong here, thank you in advance
Output of the command:-
rohan@staging:~$ proj
rohan@staging:/var/www/staging/Server/www$ branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
rohan@staging:/var/www/staging/Server/www$ echo $branch
staging
rohan@staging:/var/www/staging/Server/www$ plb
: command not found
: command not found
rohan@staging:/var/www/staging/Server/www$
export -f plbandexport -f psbin your .bash_profile