美文网首页
git alias设置,简化git命令复杂度

git alias设置,简化git命令复杂度

作者: 飞兔子 | 来源:发表于2016-12-05 11:33 被阅读0次

0:默认本地已安装git工具(windows)

1: 命令 cd ~ ,进入根目录,

2:命令 ls -la | grep .gitconfig,找到根目录下的 .gitdionfig文件

3: vi .gitconfig 修改这个文件的配置。

git config --globaluser.name"你的名字"

git config--globaluser.email"你的Email"

gitconfig配置.png

4:对应上图配置相关项

alias.ci=commit

alias.co=checkout

alias.br=branch

alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(13)<%an>%Creset' --abbrev-commit

alias.lgd=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(13)<%an>%Creset' --abbrev-commit

alias.lg2=log --pretty=format:'%h - %an -%ad -%s' --graph

alias.lg4=log --color --graph --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(yellow)%d%C(13)<%an>%Creset' --abbrev-commit

alias.st=status -s

alias.sn=show --name-status

alias.cs=config --system --list

alias.sb=show-branch

alias.lg3=log --pretty=format:'%h - %cn -%cd -%s' --graph

5:1. 在 Fork 的代码库中添加上游代码库的 remote 源,该操作只需操作一次即可。

如: 其中# upstream 表示上游代码库名, 可以任意。

git remote -v 查看本地仓库和远程关联仓库

git remote add upstream https://github.scm.corp.ebay.com/montage/frontend-ui-workspace

git fetch upstream

git merge upstream/master   //合并一个远程取回的分支

相关命令 :http://blog.csdn.net/max2005/article/details/17355303

相关文章

  • 常用 git command

    1. 设置Alias 通过设置Alias可以简化一些复杂的Git 命令。举几个例子:git status 可以简写...

  • git alias设置,简化git命令复杂度

    0:默认本地已安装git工具(windows) 1: 命令 cd ~ ,进入根目录, 2:命令 ls -la | ...

  • Git 命令总结

    Git 命令 mkdir testcd testtouch a.md alias 设置别名 git config ...

  • GitHub 进阶技巧

    alias 命令缩写 设置缩写别名:**git config --global alias.co checkout...

  • Git命令配置别名

    Git配置命令别名 git config --global -e进入config设置 在alias下面添加别名规则...

  • git配置 alias

    命令行设置git的配置 alias 配置 ~/.gitconfig 文件

  • GIT配置和命令

    推荐使用 推荐配置成每个项目单独配置的方式: GIT设置ALIAS别名 GIT更新命令 GIT搜索 在commit...

  • Git设置alias(别名)

    给常用的 git 命令添加 alias 提升效率 git alias 编辑~/.gitconfig 添加以下几行:...

  • Git技巧-别名

    通过使用别名配置,可以简化命令操作:别名设置范例: 别名设置后git co 等同于 git checkoutgit...

  • 笔记 - Git远程仓库

    利用bash alias替代Git命令

网友评论

      本文标题:git alias设置,简化git命令复杂度

      本文链接:https://www.haomeiwen.com/subject/mepkmttx.html