git-ftp / git-ftp

Uses Git to upload only changed files to FTP servers.
https://git-ftp.github.io/
GNU General Public License v3.0
5.48k stars 689 forks source link

How to handle the files that are updated directly on FTP #564

Closed sajidmanzoor10p closed 4 years ago

sajidmanzoor10p commented 4 years ago

This question is a support/help related question rather than an issue. I am planning to git-ftp. Issue is that in my team, some people don't like to use git. They want to update the files on their local and then directly the changed files to FTP

Is there any way that we can track the files that are changed directly via FTP. Is there any way that we check if file is updated on FTP then automatically create a commit and push it to Git.

LukasFritzeDev commented 4 years ago

You could have a look at the pull command:

pull (EXPERIMENTAL) : Downloads changes from the remote host into a separate commit and merges that into your current branch. If you just want to download the files without a merge, consider download. This feature needs lftp to be installed.

This creates a commit for the remote changes and merges them. I’d recommend to always do this on a clean state in your repo. As far as I know we do a git stash before downloading stuff. But it’s good to give as few potential for issues as possible.

If you want to do this automatically you can also have a look at git hooks. Maybe you could try to pull remote changes after each of your own commits (post-commit. Here is a good page with a lot of sources about git hooks: https://githooks.com Or you can use a hook provided by git-ftp that fits your needs. Please refer to the manual for details.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have found a solution for this, it would be great if you could share it here to help others. Thank you for your question.

stale[bot] commented 4 years ago

This issue will get closed for now but please feel free to re-open it if you still have this problem with Git-ftp.