Completely remove file from local and remote (GitHub) repository

This is the short version of “Remove sensitive data” article in GitHub Help. And an alternative solution to the one presented [here](Remove file from repository and from all revisions.txt). It assumes, that you are the only collaborator to repository, so you can perform steps at once (you don’t have to contact others and wait until they rebase your changes) and that your repository doesn’t use tags, so you don’t have to perform all steps.

If any these two assumptions is not correct in your case, then avoid this article and rather follow to mentioned article. Keep in mind, however, that in some certain situations, you have to contact GitHub Support in order to finish entire procedure.

Read More “Completely remove file from local and remote (GitHub) repository”

An introduction to database migrations in Yii

If you’re new to Yii migrations, these sources might be a help for you:

  1. General information: Database Migration topic in The Definitive Guide to Yii.
  2. How to create initial migration basing on current database state, explains this Stack Overflow question and GitHub Gist (with InitialDbMigrationCommand class’ code) to support it.

To use migrations, you have to properly configure console version of your Yii application. Details follows.

Read More “An introduction to database migrations in Yii”

Undo last Git commit using git undo-commit command

There are probably thousands of websites telling you, how to undo the last Git commit. For example, one of the most voted up questions on Stack Overflow. But none of them (or actually nearly none of them) answers, how to do this using git undo-commit. Simply because, such command does not exist! :> Therefore, the title of this text should rather sound “Defining own Git alias to undo last Git commit“, since this article is focused on git aliases rather than on undoing last commit in Git.

Read More “Undo last Git commit using git undo-commit command”