dpxyfa4718 2014-07-20 11:35
浏览 38

使用gitonomy gitlib库创建补丁

I am using Gitonomy libray Git lib to manipulate Git repository through php. I am to create patch file from a repository and there is no function for creating, reverting and applying patch files. There is a function named 'run' that can run git commands directly but they are ended up in exceptions. May be I am passing wrong arguments to the function. Can any one help me out in creating a patch files through Gitonomy Git lib Library. Following is the link of the library.

https://github.com/gitonomy/gitlib

Thanks and Regards, Furqan Ahmed.

  • 写回答

1条回答 默认 最新

  • doushen9863 2014-07-21 05:53
    关注

    I mentioned in the comments as examples of how to use run:

    The OP Furqan Ahmed adds

    The path of the patch file that I am giving as an argument should be replaced with 'origin/master' and it will return the patch as a string and then we have to create a file with the content and save to a location.

    git format-patch -3 HEAD --stdout > patches/third.patch 
    $repository = new Repository("/vagrant/project/devrepo/remote"); 
    $repository->run('format-patch', array('-3', 'HEAD', '--stdout', 'origin/master/project/patches/fix_empty_poster.patch'));
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据