{"id":18412060,"url":"https://github.com/elliotxx/pathmerge","last_synced_at":"2025-10-18T14:38:43.293Z","repository":{"id":86319248,"uuid":"77874893","full_name":"elliotxx/PathMerge","owner":"elliotxx","description":"目录合并小工具   A--\u003eB","archived":false,"fork":false,"pushed_at":"2019-11-11T08:05:56.000Z","size":12468,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T23:44:32.024Z","etag":null,"topics":["py2exe","python","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotxx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-01-03T01:49:44.000Z","updated_at":"2019-11-15T03:10:33.000Z","dependencies_parsed_at":"2023-07-07T06:46:05.698Z","dependency_job_id":null,"html_url":"https://github.com/elliotxx/PathMerge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2FPathMerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2FPathMerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2FPathMerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2FPathMerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotxx","download_url":"https://codeload.github.com/elliotxx/PathMerge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["py2exe","python","tool"],"created_at":"2024-11-06T03:39:36.410Z","updated_at":"2025-10-18T14:38:43.213Z","avatar_url":"https://github.com/elliotxx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PathMerge - 目录合并小工具\n## 前言\n这个程序是我做毕设的时期写的，每次去机房拷贝毕设文件到电脑，一天过后再把修改后的文件一个一个拷贝回来，覆盖，东西一多，我就不知道到底那些文件修改过了，哪些没有修改过，所以有时候辛苦了一天的文件，结果忘了复制到优盘里带走，第二天系统自动还原找不到了，实在让我很心累……**（应用场景）**\n\n于是我就写了这个小工具，它能合并目录，并自动检测修改的文件，在合并目录的时候创建旧文件的副本，拷贝新文件过来，如此，合并目录也不会丢失文件。**（作用）**\n\n该项目中我已经给出了转换之后的.exe文件，没有python环境的可以**直接运行PathMerge.exe**使用。\n\n## 快速安装\n\n### step 1 : 直接clone到本地\n\n```\ngit clone https://github.com/windcode/PathMerge.git\n```\n\n### step 2 : 进入目录执行 PathMerge.py\n\n```\npython PathMerge.py\n```\n\nps：直接运行PathMerge.exe也是可以的\n\n## 使用演示\n\n现在有两个工作空间\n\n![两个工作空间](./screenshots/1.png)\n\n工作空间1是你之前做好的一个工程或者文件夹，里面放满了文件，目录结构复杂。\n\n![空间1_1](./screenshots/2.png)\n\n![空间1_2](./screenshots/3.png)\n\n详细目录：\n\n![详细目录](./screenshots/4.png)\n\n工作空间2是你现在要工作的目录，现在是空的。\n\n![空间2](./screenshots/5.png)\n\n我们把要用的文件夹拷过来\n\n![拷贝文件](./screenshots/6.png)\n\n并在里面做一些改动。\n\n这里不放图了，总之我创建了一个文件夹，创建了两个文件，修改了三个文件……现在目录结构变成这样：\n\n![新的目录结构](./screenshots/7.png)\n\n和之前不同了，可以看到，新目录中1/下多了一个文件夹33，33/中多了两个文件111.txt和222.txt，我还修改了一个txt文件，一个ppt文件和一个word文件的内容。具体的就不贴图了。\n\n下面运行PathMerge开始合并：\n\n![运行](./screenshots/8.png)\n\n输入A目录（修改的文件夹）和B目录（原文件夹），要将A==\u003eB，A合并到B。\n\n![合并前](./screenshots/9.png)\n\n回车开始合并：\n\n![合并开始](./screenshots/10.png)\n\n合并成功！\n\n合并的记录都列在上面了，如果名称相同的文件会将旧文件创建一个副本，修改后的文件直接复制过去，程序中没有删除文件的代码，可放心食用。\n\n上图可知复制了三个文件，创建了三个旧文件副本，另外复制了创建的目录。\n\n将工作空间2中1文件做的所有改动都包含了进去。\n\n说的有点啰嗦，其实使用很简单，如果你嫌每次输入目录太麻烦的话，你也可以将命令写入脚本，每次双击运行即可。\n\n## 特性\n* 可识别加“”的目录和不加“”的目录。\n\n* 使用**MD5**识别文件是否修改。\nMD5识别文件的内容见博文：[python计算文件的md5值](http://www.cnblogs.com/yym2013/p/5482796.html)\n\n* 支持命令行执行，可用来写脚本。例：\n\n脚本目录：\n\n![脚本目录](./screenshots/11.png)\n\n脚本内容：\n\n![脚本内容](./screenshots/12.png)\n\n* 原文件夹内的旧文件不会被删除，而是创建一个带有时间戳的副本。修改过的新文件直接复制过去。\n 这样不用担心合并之后文件莫名其妙的丢失，使用该工具**不会有文件删除操作**。\n\n* 列出合并记录，统计合并信息\n\n![合并信息](./screenshots/13.png)\n\n## 注意\n* 测试环境为windows\n* 提供exe可执行文件发布器**py2exe.py**，可将python文件干净的转换为exe可执行文件。\npy2exe.py需配合PyInstaller使用，请自行下载，详情见：[使用pyInstaller发布PathMerge的exe版本（py转换成exe）](http://www.cnblogs.com/yym2013/p/5509263.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotxx%2Fpathmerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotxx%2Fpathmerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotxx%2Fpathmerge/lists"}