git - Reasons not to commit to master -
in each manual , documentation git can see single advise - "do not commit master". so, if need add changes master, need create new branch , merge it. therefore, interesting know why? advantages behavior? example, have no need in separate branch if wanna revert change - can using commit hash.
here found 1 reason - if have many commits, easyer merge branch master push commits 1 after http://waterstreetgm.org/git-why-you-should-never-commit-directly-to-master/
but if workflow divided many small tasks , each of tasks fit 1 commit. so, each branch contains 1 commit. reasons not commit master in case?
if you're working multiple people should have separate branches , merge master when bit you're adding/changing finished , tested.
if you're on own small project there isn't of distinction. if adding functionality, tags used able come given commit.
not committing master prevents colliding commits , having merge each time 2 people change same file.
Comments
Post a Comment