I'm using git-for-windows and want to write a bash function to update the current working branch to master. Here is what i have written:
sync() {
branch = $(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
git checkout master
git pull origin/master
git checkout $branch
}
However, when i call this function, it throws an error:
bash: branch: command not found
How can i solve this problem?