zoukankan      html  css  js  c++  java
  • git使用前配置

    1、git push origin <当前分支>:refs/for/<当前分支>,简化为git gpush

    执行配置:

    git config --global alias.gpush '!f() { : push ; r=$1; [[ -z $r ]] && r=origin; b=$2; t=$(awk "{ print $2 }" $(git rev-parse --git-dir)/HEAD); t=${t#refs/heads/}; [[ -z $b ]] && b=$t; cmd="git push $r HEAD:refs/for/$b%topic=$t"; echo $cmd; echo; $cmd; }; f'

    然后

    设置:

    git config —local remote.origin.push ‘refs/heads/:refs/for/‘

    取消

    git config —unset —local remote.origin.push

     

    2、自动补全

    curl -s http://svn.baidu.com/downloads/git-completion.bash >~/.git-completion.bash
    source ~/.git-completion.bash

    3、账号配置:

    git config —global user.email liyanlei01@baidu.com (把liyanlei01badiu.com改为你的邮箱)
    git config —global user.name liyanlei01 (把yangyang22改为你的账号)

    4、秘钥配置:

    ssh-keygen -t rsa # 一路回车选默认选项

    之后creata或者clone一个仓库即可操作。

  • 相关阅读:
    HDOJ 2011
    OpenCV学习笔记(1)——VS2010 下安装OpenCV 2.4.4安装
    OC——Foundation—常用的类(2)----NSArray
    OC——Foundation—常用的类(1)字符串(NSString)
    OC——Foundation—结构体
    OC----Block语法
    OC----protocol语法
    OC----初识
    OC----内存管理
    OC----Category语法
  • 原文地址:https://www.cnblogs.com/Walker-lyl/p/6806245.html
Copyright © 2011-2022 走看看