Rollback to an old Git commit in a public repo

Try this: git checkout [revision] . where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab). Don’t forget the . at the end, very important. This will apply changes to the whole tree. You should execute this command in the git project root. If you are in any sub directory, then this command only changes the … Read more

How to ignore certain files in Git

The problem is that .gitignore ignores just files that weren’t tracked before (by git add). Run git reset name_of_file to unstage the file and keep it. In case you want to also remove the given file from the repository (after pushing), use git rm –cached name_of_file.

How to recover stashed uncommitted changes

The easy answer to the easy question is git stash apply Just check out the branch you want your changes on, and then git stash apply. Then use git diff to see the result. After you’re all done with your changes—the apply looks good and you’re sure you don’t need the stash any more—then use … Read more

Is there a git-merge –dry-run option?

As noted previously, pass in the –no-commit flag, but to avoid a fast-forward commit, also pass in –no-ff, like so: $ git merge –no-commit –no-ff $BRANCH To examine the staged changes: $ git diff –cached And you can undo the merge, even if it is a fast-forward merge: $ git merge –abort

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