Git裸仓库的Active Branch切换方法 在服务器上通过init --bare创建了一个裸仓库作为远程仓库使用,并且存在三个分支(master/kid/develop),但在使用中发现代码虽然能正常提交,但是远程仓库中没有显示我的提交记录,发现原来是远程仓库的活动分支在kid上,git log不会显示develop分支上的记录.但是通过git checkout develop会提示"fatal: This operation must be run in a work tree"
1. 管理员身份登录GitHub,找到项目2. Settings-->Branches-->Protected branches--->Choose a branch... ,选择需要保护的分支,然后点击edit按钮,3. Branch protection for 所选的分支名 --> 勾选Restrict who can push to this branch People and teams with push access 若不选择任何人,则任何人都没有push代码到