0

I have a production server where I work without using GIT, I have the files on my PC and upload updates with filezilla.

I discovered git and I would use it as a replacement for filezilla.

I already configured git on the PC and I did a push of all the project files in the repository, now I do not know what to do to configure updates on the production server.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

0

The legacy way is to define a bare repo on your server and push to that bare repo, combined with a post-receive hook to checkout the received files in the folder of your choice/

But with Git 2.3+, if you want, you can:

  • initialize a repo directly on the target folder in your server,
  • add and commit everything
  • set:

    git config receive.denyCurrentBranch updateInstead
    
  • clone that repo on your local PC.
    I assume you can use the same ssh access you must have set in filezilla:

    git clone user@server:/path/to/git/repo
    
  • make new commits,

  • push directly to a non-bare repo
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • you mean to push the files to the repository from the production server instead from my pc and then clone from repository to my pc...right? – user1739269 Nov 18 '16 at 15:12
  • Yes, but once cloned on your PC, you can work and push back from your PC. – VonC Nov 18 '16 at 16:53