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.

Answers


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

or

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.


Need Your Help

Is there any way to revert the current build in Jenkins?

git jenkins

My newly created deployment team is struggling to find a way to revert a currently deployed build. They have integrated Jenkins with Git and Bitbucket

Export HTML table to Excel file

javascript jquery html excel

I've been looking into some jQuery plugins that are capable of doing this. I decided to use the one at http://www.jqueryscript.net/table/Export-Html-Table-To-Excel-Spreadsheet-using-jQuery-table2e...