Ignore .pyc files in git repository

Put it in .gitignore. But from the gitignore(5) man page: So, either specify the full path to the appropriate *.pyc entry, or put it in a .gitignore file in any of the directories leading from the repository root (inclusive).

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: 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 convert your files: core.autocrlf is described on the … Read more

How do I “un-revert” a reverted Git commit?

git cherry-pick <original commit sha>Will make a copy of the original commit, essentially re-applying the commit Reverting the revert will do the same thing, with a messier commit message:git revert <commit sha of the revert> Either of these ways will allow you to git push without overwriting history, because it creates a new commit after the revert.When … Read more

Git merge reports “Already up-to-date” though there is a difference

The message “Already up-to-date” means that all the changes from the branch you’re trying to merge have already been merged to the branch you’re currently on. More specifically it means that the branch you’re trying to merge is a parent of your current branch. Congratulations, that’s the easiest merge you’ll ever do. 🙂 Use gitk … Read more

Specify an SSH key for git push for a given domain

Even if the user and host are the same, they can still be distinguished in ~/.ssh/config. For example, if your configuration looks like this: Then you just use gitolite-as-alice and gitolite-as-bob instead of the hostname in your URL: Note You want to include the option IdentitiesOnly yes to prevent the use of default ids. Otherwise, … Read more

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