84669 人学习
152542 人学习
20005 人学习
5487 人学习
7821 人学习
359900 人学习
3350 人学习
180660 人学习
48569 人学习
18603 人学习
40936 人学习
1549 人学习
1183 人学习
32909 人学习
弄了个静态博客,但是每次上传觉得挺麻烦的,git add .,git commit -m '',git push origin gh-pages什么的...麻烦死了...啊对了我是在Windows下..
git add .
git commit -m ''
git push origin gh-pages
所以我就想写成一个.bat的批处理脚本试试(blog的话commit log也不用天天写0_0)
.bat
结果写到调用Git bash之后就不知道怎么办了,对批处理不是很懂,所以在这里请教下大大们
Git bash
欢迎选择我的课程,让我们一起见证您的进步~~
方法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
alias blog='git add .;git commit -m "blog update"';git push origin gh-pages
以后要更新博客时,直接执行 blog
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'
git config --global alias.blog '!git add . && git commit -m "blog update" && git push origin gh-pages'
或者
编辑 .gitconfig 文件,加上这么一段:
[alias] blog = !git add . && git commit -m 'blog update' && git push origin gh-pages
以后要更新博客时,执行 git blog
git blog
其实,在git的安装目录下。建立一个git-xxx文件,用shell去写那个文件。然后使用
git xxx
就可以运行了。。
比如,你的需求是连续使用git add, git commit, git push, 可以在那个目录里,添加"git-acp"文件,内容如下
#!/bin/sh git add . git commit -am "" git push origin gh-pages
然后,在需要调用的目录里,调用
git acp "Commit Message"
就可以了。。
而且,如果你不用shell,而是用python或者其他编程语言,也是可以的。。
骚年。有TortoiseGit用啊。小乌龟啊。跟svn一样一样的。https://code.google.com/p/tortoisegit/
方法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
其实,在git的安装目录下。建立一个git-xxx文件,用shell去写那个文件。然后使用
就可以运行了。。
比如,你的需求是连续使用git add, git commit, git push, 可以在那个目录里,添加"git-acp"文件,内容如下
然后,在需要调用的目录里,调用
就可以了。。
而且,如果你不用shell,而是用python或者其他编程语言,也是可以的。。
骚年。有TortoiseGit用啊。小乌龟啊。跟svn一样一样的。https://code.google.com/p/tortoisegit/