How can I iterate through all the local branches in my repository using bash script. I need to iterate and check is there any difference between the branch and some remote branches. Ex
for branch in $(git branch);
do
git log --oneline $branch ^remotes/origin/master;
done
I need to do something like given above, but the issue I'm facing is $(git branch) gives me the folders inside the repository folder along with the branches present in the repository.
Is this the correct way to solve this issue? Or is there another way to do it?
Thank you