# shell-git **Repository Path**: sense7/shell-git ## Basic Information - **Project Name**: shell-git - **Description**: git仓库进行数据同步的一个java库,基于shell命令实现 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-20 - **Last Updated**: 2022-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # shell-git ### 通过执行shell命令来对git仓库进行pull的工具 #### 目前实现 - git log 查看最新一次sha值 - git pull - git remote 远端仓库地址查看 #### 开发原因、背景 - 业务需求需要从nas盘同步数据到本地盘,用的是git仓库来做版本管理(比较省事) - 以前我们选择的是jgit,但是在产线上多次发现pull后有内存泄漏的现象(越大的仓库越明显) 该库使用代码片段: https://gitee.com/sense7/codes/0khyzcxpasrqbwfdluign24 ``` org.eclipse.jgit org.eclipse.jgit 5.2.0.201812061821-r ``` #### 使用 ```java public static void main(String[] args) throws GitException { File localRepo = new File("F:\\gittest\\B\\Base"); ShellGit.checkAndPull(localRepo); } ```