>  Q&A  >  본문

shell - Git批处理脚本

弄了个静态博客,但是每次上传觉得挺麻烦的,git add .,git commit -m '',git push origin gh-pages什么的...麻烦死了...啊对了我是在Windows下..

所以我就想写成一个.bat的批处理脚本试试(blog的话commit log也不用天天写0_0)

结果写到调用Git bash之后就不知道怎么办了,对批处理不是很懂,所以在这里请教下大大们

天蓬老师天蓬老师2734일 전808

모든 응답(3)나는 대답할 것이다

  • 巴扎黑

    巴扎黑2017-04-24 09:13:29

    방법 1:
    여기에서: http://mayecn.com/blog/2013/05/03/multiple-alias/

    git bash에서 먼저 실행:
    alias blog='git add .;git commit -m "blog update"';git push origin gh-pages

    나중에 블로그를 업데이트하고 싶다면 실행하세요 blog


    방법 2:
    여기에서: http://stackoverflow.com/questions/7534184/git-alias-multiple-commands-and-parameters

    git bash에서 실행
    git config --global alias.blog '!git add . && git commit -m "blog update" && git push origin gh-pages'

    또는

    .gitconfig 파일을 편집하고 다음 단락을 추가하세요.

    으아악

    향후 블로그를 업데이트하고 싶다면 git blog

    을 실행하세요.

    회신하다
    0
  • PHP中文网

    PHP中文网2017-04-24 09:13:29

    실제로는 git 설치 디렉터리에 있습니다. git-xxx 파일을 생성하고 쉘을 사용하여 해당 파일을 작성합니다. 그런 다음

    을 사용하세요. 으아악

    실행 준비가 되었습니다. .

    예를 들어, git add, git commit, git push를 계속해서 사용해야 하는 경우 다음 내용이 포함된 "git-acp" 파일을 해당 디렉터리에 추가할 수 있습니다.

    으아악

    그런 다음 호출해야 하는 디렉터리에서

    을 호출합니다. 으아악

    그렇습니다. .

    그리고 쉘을 사용하지 않고 파이썬이나 다른 프로그래밍 언어를 사용하는 경우에도 가능합니다. .

    회신하다
    0
  • 迷茫

    迷茫2017-04-24 09:13:29

    상니안. TortoiseGit을 사용하세요. 작은 거북이. svn과 동일합니다. https://code.google.com/p/tortoisegit/

    회신하다
    0
  • 취소회신하다