Git lesson : Branch

What is GIT?
Git is…

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.

Git is used for version control of files, much like tools such as Mercurial, Subversion, CVS, Perforce, and Visual SourceSafe.

A single git repository can maintain multiple branches of development.

Get a list of all existing branches

git branch

Result :

 * master 

Create a new branch (named test)

git branch test

Switch from default “master” to the test branch

git checkout test

Force to switch branch from “master” to the test branch

git checkout -f test

Merge test branch with “master” because two branches have diverged, different changes made in each

git merge test

If there are conflicts with the changes, show markers

git diff

Push the “test” branch to remote repo

git push origin test

Pull the remote “test” branch to local repo

git pull origin test

Delete remote “test” branch

git push origin :test

Delete local “test” branch

git branch -d test

>> Use it when changes in the test branch are already in “master” branch

git branch -D test

>> force delete test branch

How to find CentOS or RedHat version?

Most Red Hat-based distributions, like CentOS, should have a file called redhat-release which will contain the CentOS version

Run the following to see what version running on your system

tail /etc/redhat-release


cat /etc/redhat-release


cat /etc/*release*


rpm -q centos-release

Using your redhat-release file, you can find your distribution, version and update number. This information is very helpful for technical support staff as well as knowing if you are up to date with the latest patches

How to disable phpinfo

The phpinfo() function is a very powerful one,  you can learn quite a lot about your PHP installation. Some server administrators may choose to disable the PHP function phpinfo() for security reasons, because it displays information which can be used to compromise the server that your site is running on. You can completely disable phpinfo(). First find the php.ini file :

php -i| grep php.ini

Open php.ini with VI or Pico.

#vi php.ini 

change the line that includes the disable_functions directive so that it says :

disable_functions = phpinfo

– If you have access to WHM, login to WHM. See Service Configuration on the Right Sidebar. Click PHP Configuration Editor. Click Switch to Advanced Mode. Find the disable_functions directive, add the following in that directive


– If you only have access to .htaccess, you can use the following In .htaccess, add a line that says

php_value disable_functions phpinfo

Note: disable phpinfo means that you cannot check PHP version with phpinfo()