I have a remote repo I cloned a while ago. Local .config has this:
[remote "origin"]
url = ...
fetch = +refs/heads/branch1:refs/remotes/origin/branch1
[branch "branch1"]
remote = origin
merge = refs/heads/branch1
Now I know that my coworkers have created a new remote branch - "branch2". I want to fetch it and then checkout. Also I don't want to fetch all the branches - only the new one. The only way I know is modifying .config by adding
fetch = +refs/heads/branch2:refs/remotes/origin/branch2
and then do "git pull"
Is there a way to add fetching new branch through git command? I don't want to edit config every time I need a new branch.