How do you sync changes from a local project to Github in the cloud, using PHPStorm. And then how do you retrieve the changes on a remote server?

Given the following setup:

  • Mac/PC
  • PhpStorm
  • Git enabled on local directory
  • Using Laravel Valet

You publish your changes to Github by using VCS menu, Commit, Push

Now your changes are at Github, but how do you get them down to a remote server?

The solution is to use Git Fetch and Git Pull, or to do these both at once:

git fetch && git pull

See also list of useful Git commands.

Examples below:

[arb@cp1 bitcoin-spread]$ git fetch

remote: Enumerating objects: 13, done.

remote: Counting objects: 100% (13/13), done.

remote: Compressing objects: 100% (5/5), done.

Unpacking objects: 100% (8/8), done.

remote: Total 8 (delta 3), reused 8 (delta 3), pack-reused 0

From https://github.com/eugenevdm/bitcoin-spread

   32630a1..afd1c33  master     -> origin/master

[arb@cp1 bitcoin-spread]$ git pull

Updating 32630a1..afd1c33

Fast-forward

 app/Console/Commands/{UpdateCommand.php => UpdateSpreadCommand.php} | 9 ++++++—

 app/Console/Kernel.php                                              | 2 +-

 credentials.json                                                    | 1 +

 token.json                                                          | 1 +

 4 files changed, 9 insertions(+), 4 deletions(-)

 rename app/Console/Commands/{UpdateCommand.php => UpdateSpreadCommand.php} (74%)

 create mode 100644 credentials.json

 create mode 100644 token.json

Tags

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top