{"id":20749194,"url":"https://github.com/tharushaudana/git-change-copy-python","last_synced_at":"2026-05-16T09:35:36.961Z","repository":{"id":246326949,"uuid":"820756867","full_name":"tharushaudana/git-change-copy-python","owner":"tharushaudana","description":"GitCCPy is a tool designed to help developers upload only changed files to an FTP server. By leveraging Git, it identifies modified files and copies them to a specified location, simplifying the deployment process.","archived":false,"fork":false,"pushed_at":"2024-06-29T03:56:10.000Z","size":9357,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T15:57:21.754Z","etag":null,"topics":["changes","files","ftp","ftp-client","git","git-ftp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tharushaudana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T05:55:52.000Z","updated_at":"2024-06-29T03:52:30.000Z","dependencies_parsed_at":"2024-11-17T23:04:32.305Z","dependency_job_id":null,"html_url":"https://github.com/tharushaudana/git-change-copy-python","commit_stats":null,"previous_names":["tharushaudana/git-change-copy-python"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tharushaudana/git-change-copy-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharushaudana%2Fgit-change-copy-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharushaudana%2Fgit-change-copy-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharushaudana%2Fgit-change-copy-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharushaudana%2Fgit-change-copy-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tharushaudana","download_url":"https://codeload.github.com/tharushaudana/git-change-copy-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharushaudana%2Fgit-change-copy-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33097030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["changes","files","ftp","ftp-client","git","git-ftp"],"created_at":"2024-11-17T08:21:34.343Z","updated_at":"2026-05-16T09:35:36.941Z","avatar_url":"https://github.com/tharushaudana.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitCCPy - Selective File Copy for FTP Deployment\n\n## Overview\n\nIn website development, developers often need to upload only changed files to an FTP server. However, most FTP client applications do not include this feature. To address this, I have created a solution using Python.\n\n## What does this solution do?\n\nThis solution provides a Python script that executes the `git diff-tree` command to identify changed files. It then copies all changed files into a specified location, allowing developers to upload only those changed files to the FTP server using their preferred FTP client software.\n\n## Instructions\n\n### Step 1: Create Configuration File\n\nCreate a `.gitccpy` configuration file in the directory where Git is initialized. Below is an example of the content:\n\n```\nLOCAL_PREFIX=specific/path/\nDESTINATION_PATH=des/path\n```\n\n- `LOCAL_PREFIX`: Specifies the directory within the project from which to copy changed files. It can be left empty (e.g., `LOCAL_PREFIX=`) to copy all changes from the entire project.\n- `DESTINATION_PATH`: Specifies the destination path where the changed files will be copied. This includes creating the necessary containing folders.\n\n### Step 2: Usage with Python\n\nRun the script with the following command structure:\n\n```\npython gitccpy.py \u003ccommit-id\u003e\n```\n\n- `\u003ccommit-id\u003e`: The commit ID to compare against. The default value is `HEAD`.\n\n### Step 3: Usage with Executable\n\nIf you have an executable version of the script, use the following command structure:\n\n```\ngitccpy \u003ccommit-id\u003e\n```\n\n- `\u003ccommit-id\u003e`: The commit ID to compare against. The default value is `HEAD`.\n\n### New Features\n\nAs of the latest update, the script has the following new features:\n\n- **Read All Commits**: The script reads all commit IDs from the specified commit ID to `HEAD` (including the specified commit ID itself) using the `git rev-list` command and copies all changes of all commits.\n- **Store Last Commit ID**: After copying files, the script stores the `HEAD` commit ID in a file named `.gitccpy.lastcommit`.\n- **Automatic Incremental Updates**: The next time you run the `gitccpy` command without specifying a commit ID, the script reads all commits after the stored last commit ID (excluding the last commit itself).\n\n### Example\n\nTo copy changed files from a specific directory to the destination path, set the configuration as follows:\n\n```\nLOCAL_PREFIX=src/\nDESTINATION_PATH=/var/www/html/\n```\n\nTo run the script and copy the changed files based on the latest commit:\n\n```\npython gitccpy.py\n```\n\nOr using the executable:\n\n```\ngitccpy\n```\n\nThis will copy all changed files in the `src/` directory to the `/var/www/html/` directory, preserving the folder structure. After the operation, the `HEAD` commit ID will be saved in `.gitccpy.lastcommit`.\n\nTo copy changes based on a specific commit ID and update the last commit record:\n\n```\npython gitccpy.py \u003ccommit-id\u003e\n```\n\nOr using the executable:\n\n```\ngitccpy \u003ccommit-id\u003e\n```\n\nThis will copy all changed files from the specified commit ID to `HEAD` and update the `.gitccpy.lastcommit` file.\n\n## Conclusion\n\nWith this script, developers can efficiently upload only the changed files to an FTP server, streamlining the deployment process and saving time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharushaudana%2Fgit-change-copy-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftharushaudana%2Fgit-change-copy-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharushaudana%2Fgit-change-copy-python/lists"}