zoukankan      html  css  js  c++  java
  • 获得最近一天的提交,并使用winscp上传到服务器

    @echo off
    D:devGitingit.exe pull origin master
    D:devGitingit.exe add -A
    D:devGitingit.exe commit -m someupdate
    D:devGitingit.exe push origin master
    set SESSION=sftp://user:password@ip:22
    set LOCAL_PATH=D:proyourproject
    set REMOTE_PATH=/public_html/
    del list.txt
    rem git diff --name-only HEAD~ HEAD >> list.txt 
    git log --pretty=format: --name-only --since="1 days ago" >> list.txt 
    echo open %SESSION% >> script.tmp
    rem Generate "put" command for each line in list file
    setlocal ENableDelayedExpansion
    chcp 1250
    for /F %%i in (list.txt) do (
    set str=%%i
    call set str=%%str:/=\%%
    echo put "%LOCAL_PATH%!str!" "%REMOTE_PATH%%%i" >> script.tmp
    )
    echo exit >> script.tmp
    winscp.com /script=script.tmp
    set RESULT=%ERRORLEVEL%
    del script.tmp
    rem Propagating WinSCP exit code
    exit /b %RESULT%
    

      

  • 相关阅读:
    jdk1.8安装与配置
    java编译器——idea的安装
    原型设计作业
    案例分析作业
    202103226-1 编程作业
    阅读任务
    准备工作
    java课程总结
    第十四周总结
    第十三周总结
  • 原文地址:https://www.cnblogs.com/meetrice/p/10569747.html
Copyright © 2011-2022 走看看