Mixed vagrant enviroments, check where does url load from

I had many vagrant machines and haven't really paid much attention to setting unique hostname, machine name and IP address, which resulted in mixed environments. Meaning I loaded one URL and I got files and database from the other vagrant machine. To debug what was really happening I went into devel/php and found out where is my mind I mean Index file :) to do that I echoed it like this.

Install composer and drush globally

You may get this message trying to update drush globally via composer,
"To initialize a project, please create a composer.json file as described in the...."

so lets make it sure both are globally installed and required.

Download phar file with

curl -sS https://getcomposer.org/installer | php

then move it to /usr/local

GIT - reseting hard, moving to previous commit after merge

git reset --hard c517b565b2bcc0cf2ca5265b6ea6657f253fe2af
git push -f

to move git to previous commit and push it to remote server, we first need to reset hard to SHA value and then push it with force to overide current state

 

GIT - reverting merge (pull request gonne wrong)

Find a commit hash where merge occured to master and then

git revert -m 1 <commit-hash> 
git commit -m "Reverting the last commit which messed the repo."
git push -u origin master

 

 

GIT - checking status of master and differences

Before final git pull to LIVE site, it is a good idea to check what is going to be pulled. So to do that

Git fetch
git diff master origin/master

or 

git diff --name-only master origin/master

This should give you more insight on what is going to be pulled in the end, as this marks differences between current master branch on LIVE site and master on github.

Debugging ajax calls/requests

In case ajax calls are making a trouble and developer needs more information about what is happening regarding: