示例#1
0
def branch_is_exist(branch_name):
    # git rev-parse --verify <branch_name> # 返回值等于0的时候存在. 和下面命令等价
    command = "git show-ref --verify --quiet refs/heads/" + branch_name
    try:
        subprocess_check_run(command)
        return True
    except:
        return False
示例#2
0
 def test_subprocess_check_run(self):
     cli.subprocess_check_run('ls')
示例#3
0
def git_tag(tag):
    subprocess_check_run("git tag -a " + tag)
    return
示例#4
0
def delete_branch(branch):
    subprocess_check_run("git branch -d " + branch)
示例#5
0
def checkout(branch):
    subprocess_check_run("git checkout " + branch)
示例#6
0
def diff():
    # todo: implement the diff
    '''
    :return:
    '''
    subprocess_check_run('git diff')
示例#7
0
文件: gy.py 项目: jer251997/general
def tag(tag_name):
    subprocess_check_run("git tag -a " + tag_name)
    return