Compare two MySQL databases [closed]

If you’re working with small databases I’ve found running mysqldump on both databases with the –skip-comments and –skip-extended-insert options to generate SQL scripts, then running diff on the SQL scripts works pretty well. By skipping comments you avoid meaningless differences such as the time you ran the mysqldump command. By using the –skip-extended-insert command you … Read more

How to colorize diff on the command line

Man pages for diff suggest no solution for colorization from within itself. Please consider using colordiff. It’s a wrapper around diff that produces the same output as diff, except that it augments the output using colored syntax highlighting to increase readability: diff old new | colordiff or just: colordiff old new Installation: Ubuntu/Debian: sudo apt-get … Read more

How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?

Copy the diff file to the root of your repository, and then do: git apply yourcoworkers.diff More information about the apply command is available on its man page. By the way: A better way to exchange whole commits by file is the combination of the commands git format-patch on the sender and then git am … Read more

git-diff to ignore ^M

GitHub suggests that you should make sure to only use \n as a newline character in git-handled repos. There’s an option to auto-convert: $ git config –global core.autocrlf true Of course, this is said to convert crlf to lf, while you want to convert cr to lf. I hope this still works … And then … Read more