How do I fix a Git detached head?

Detached head means you are no longer on a branch, you have checked out a single commit in the history (in this case the commit previous to HEAD, i.e. HEAD^). If you want to delete your changes associated with the detached HEAD You only need to checkout the branch you were on, e.g. git checkout … Read more

Make the current Git branch a master branch

The problem with the other two answers is that the new master doesn’t have the old master as an ancestor, so when you push it, everyone else will get messed up. This is what you want to do: git checkout better_branch git merge –strategy=ours master # keep the content of this branch, but record a … Read more

How to compare files from two different branches

git diff can show you the difference between two commits: git diff mybranch master — myfile.cs Or, equivalently: git diff mybranch..master — myfile.cs Note you must specify the relative path to the file. So if the file were in the src directory, you’d say src/myfile.cs instead of myfile.cs. Using the latter syntax, if either side … Read more

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