First of all, you have to own Magento 2 installed and then log in as Magento server user with permissions to write to the Magento 2 file system.
Next, you must ensure that you can run Magento commands from any directory. So, to warrant, add <your Magento install dir>/bin to your system PATH.
Update Magento 2
Log in as a user with permissions to modify files in the file system of Magento
Save all changes to composer.json since following actions will cover it:
cd <your Magento install dir>
cp composer.json composer.json.old
Use the following guide, in case when the optional sample data has been installed:
rm –rf dev/tools/Magento/Tools/SampleData/
Update your local repository to get the latest code:
git pull origin master
There are two main branches in Magento 2 GitHub repository: master and develop. Master provides the most updated version of code and develop serves some new features and repairs which are not ready for production.
With the support from composer update, doffing and merging composer.json.old with composer.json installed with Magento 2 software.
Run the command php bin/magento setup : upgrade to update Magento 2 data after manipulations with composer.json.
Finish the final step by running command rm –rf var/generation/* var/cache/* to clear var directory contents.
It is all about updating Magento 2. If you have any problems in the update process, contact us for the help.