0

I am using Git to track my projects and what I usually do is I clone git project in live server and then do push from localhost or pull from live server.

Now, I'm wondering if let's say instead doing git push from my live server, I ftp the files via FTP client like transmit.

For example I have a folder git-test, it has .git file in it and then, I ftp git-test folder to live server using transmit.
The live server will still have .git in git-test folder.

  1. The question is does the git functions still work if doing it this way?
  2. If it works, so what's the difference between the two approach? Which one is the best practice?
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
astrasleepz
  • 414
  • 2
  • 7

1 Answers1

1

The question is does the git functions still work if doing it this way?

git would run on the server just fine, in that it would recognize the folder with its nested .git as a repo.

You can consider a tool like git-ftp for the transfer, which is safer that transferring every single files.

If you are not using that tool, then a better practice (with ftp) would be to use git bundle: that means transferring one file (from which you cna git clone on the server).
See "Backup a GitHub repository".


Note: using ftp isn't considered "best practice" anymore (see its multiple security concerns).
Using git is a possible solution, and that is why the latest git versions come with push-to-deploy and push-to-checkout.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283