0
回答
简单GIT测试批处理
终于搞明白,存储TCO原来是这样算的>>>   

一个思路,方便新建、删除一个GIT仓库,查看LOG,新增,向文件添加内容

gi(init),ug(un git),gl(git log),a(add),ap(append)  .bat


gi.bat
@echo off
cmd /c "git init"
echo hello>welcome.txt
cmd /c "git add ."
git commit -m "init"


ug.bat 删除本目录
@echo off
rm -r -f  .* * 2>nul

gl.bat
@echo off
git log

a.bat

@echo off
echo %1 >%2

ap.bat

@echo off
echo %1 >>%2

少敲了好几个命令 :)

===================

使用

gi
Initialized empty Git repository in D:/scm/GIT/.git/
[master (root-commit) 50c1f28] init
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 welcome.txt

gl

commit 50c1f287749221386f2f4dcc5064d8487fbe9495
Author: ddatsh <ddatsh@gmail.com>
Date:   Thu Sep 29 11:41:07 2011 +0800

    init

 

a second 1

git st
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       1
nothing added to commit but untracked files present (use "git add" to track)

 

ap add welcome.txt

git st
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   welcome.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       1
no changes added to commit (use "git add" and/or "git commit -a")

 

Git
举报
ddatsh
发帖于6年前 0回/643阅
顶部