Prevent commits in master branch

Yes, it is possible. You must create a pre-commit hook which rejects commits to the master branch. Git doesn’t call a pre-commit hook when you call the merge command, so this hook will be rejecting only regular commits. Go to your repository. Create a file, .git/hooks/pre-commit, with the following content: #!/bin/sh branch=”$(git rev-parse –abbrev-ref HEAD)” … Read more

What are the differences between `–squash` and `–no-ff –no-commit`?

The differences These options exists for separate purposes. Your repository ends up differently. Let’s suppose that your repository is like this after you are done developing on the topic branch: –squash If you checkout master and then git merge –squash topic; git commit -m topic, you get this: –no-ff –no-commit Instead, if you do git … Read more

How to do a fast-forward merge on GitHub?

Looks like GitHub does not support this – and this is a TERRIBLE affair. You basically CANNOT run an atomic, linear commit strategy (the best there is) using the GitHub UI. Note that Bitbucket DOES support this, and has much more fine-grained options for setting up the PR landing/integration strategy. Namely the ‘Rebase, fast-forward’ option which … Read more

Why does git perform fast-forward merges by default?

Fast-forward merging makes sense for short-lived branches, but in a more complex history, non-fast-forward merging may make the history easier to understand, and make it easier to revert a group of commits. Warning: Non-fast-forwarding has potential side effects as well. Please review https://sandofsky.com/blog/git-workflow.html, avoid the ‘no-ff’ with its “checkpoint commits” that break bisect or blame, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)