Why does git produce a merge conflict when lines next to each other are changed?

The reason that Git behaves like this is explained well in the answers to this question: https://softwareengineering.stackexchange.com/questions/194788/why-doesnt-git-merge-adjacent-lines-without-conflict/378258#378258 Essentially, because you need the neighboring lines to provide context to the change (you can’t just use line numbers, because something may have been added or deleted above), if the lines around it have changed you usually don’t … Read more

How does git know which ssh key to use for its operations?

Git does not know, or care. It just runs ssh. How does ssh know? It looks at your ~/.ssh/config file (edit: or gets it from ssh-agent; see below): Host github.com # IdentitiesOnly yes # see below to decide if you want this IdentityFile ~/.ssh/github_id_file Host domain.com IdentitiesOnly yes # again, see below IdentityFile ~/.ssh/another_id_file Edit: … Read more

Automatically mirror a git repository

I wrote a post-commit hook for just this purpose. The hook itself is simple; just add a file named post-commit to your .git/hooks/ directory with the following contents: git push my_remote The post-commit file should be executable. Also make sure that you add a suitable remote repository with the name my_remote for this this hook … Read more

Git: file “changed but not updated”

You have to use git add every time OR use git commit -a or git commit –all instead of plain git commit. from Git docs: -a –all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected. add is basically … Read more

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