Sometimes I type accidentaly the wrong branch name, when I do "git pull origin BRANCH".
Is there a way to forbid "git pull origin XXX" when XXX is not the same branch I have currently checked on my local repository? i.e. allow "git pull" only if the local-checked branch is XXX and not YYY.
That is, I do want "merge" to hapen, but only if I pull the same branch I have currently checked in my local repository. Is there a way I can configurate the local repository to allow "git pull" only from the same branch-name?
For example:
Case 1:
Current checked branch on local repository is "test"
[* test ] /code$ git pull origin master
This merges the code from "test"-branch to my local "master" branch. ==> I want to forbid this.
Case 2:
Current checked branch on local repository is "master"
[* master ] /code$ git pull origin master
This merges the changes from remote "master" branch to my local "master" branch. ==> This is ok.
I hope I explained my problem well.
Thanks in advance.