Prevent direct commits on master branch in git repository and accept merges only?

前端 未结 6 1175
误落风尘
误落风尘 2021-02-05 02:10

My git repository has two branches, \'master\' and \'dev\'.

Code committed to \'dev\' goes through an automated build process before it is tested. Code that passes this

6条回答
  •  萌比男神i
    2021-02-05 02:32

    Make local branch

     command: git branch 
    

    Go to branch through

    Command: git checkout      
    

    Now your all local work save (through add . & commit ) into branch and then push to remote through

    command : git push origin 
    

    after that you can make pull request to master and merge to master. This is answer based on the linux (Ubuntu) system environment.

    If any miss then let me know?

提交回复
热议问题