Deleted local master branch
I was sloppy and was deleting a whole bunch of local branchs, instead of doing them one by one after each one was done, and I accidentally deleted my local master branch on git. The project is still up at github. So how do I resolve this issue? If it helps I'm using terminal on a mac.
git branch master origin/master
Master branch is not a special branch, it can easily be created just as any other branch.
git branch master ## creating master branch git checkout master ## switching to master branch git branch -u origin/master ## setting up remote tracking branch
git branch master ## creating master branch git branch -u origin/master master ## setting up remote tracking without switching git checkout master ## switching out to master
or all in one
git checkout -b master origin/master ## create, set up tracking, switch
You can simple do,
git checkout master
Git will pull master branch if you don't have it in local.