# git-push-dir **Repository Path**: hsg965/git-push-dir ## Basic Information - **Project Name**: git-push-dir - **Description**: 一款基于Git的部署工具,可将指定目录推送至远程Git仓库。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-02 - **Last Updated**: 2026-01-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # git-push-dir - 基于Git的部署工具 - 可将指定目录推送至远程Git仓库 ## 使用方法 1. 安装依赖 ```bash npm install git-push-dir ``` 2. 引入模块 ```javascript // deploy.js import { deploy } from 'git-push-dir' deploy({ /** 远程仓库地址 (例如: https://gitee.com/user/repo.git) */ remoteUrl: string; /** 推送的分支名,默认为 'dist' */ branch?: string; /** 项目根目录,默认为 process.cwd() */ rootDir?: string; /** 构建输出目录名 (相对于 rootDir),默认为 'dist' */ distDir?: string; /** 需要从根目录复制到发布目录的文件列表 */ filesToCopy?: string[]; /** 自定义日志打印函数 */ logger?: (msg: string) => void; }); ``` 3. 控制台执行 ```bash node deploy.js ```