From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/

http://openwares.net/linux/gerrit_workflow.html

git config --system  配置全局           对应/etc/gitconfig

git config --global   配置当前用户      对应/root/.gitconfig文件

git config               配置当前版本库   对应版本库下.git/config

用户信息配置:
git config user.name <username>
git config user.email <email>
编辑器配置:
git config core.editor vim
git config core.color auto
颜色配置:
git config color.status auto
git config color.diff auto
git config color.branch auto
git config color.interactive auto
一次性打开所有颜色:
git config color.ui true
日志格式:
git config format.pretty oneline
提交模板:
git config commit.template '/etc/git-commit-template'
 

配置http仓库密码

使用http地址访问仓库时,每次进行push操作都会提示输入用户名和密码,比较麻烦。可以进行配置。

对于1.7.9及之后的版本

git config --global credential.helper cache    

如果需要加上失效时间,可以如下配置

git config credential.helper 'cache --timeout=3600'

则密码会在1小时后失效

存储在磁盘上

git config --global credential.helper store

对于1.7.9之前的版本

需要显式的在git地址中加入用户名和密码,如https://you:password@github.com/you/example.git

git config remote.origin.url https://you:password@github.com/you/example.git

修改提交者的用户名和邮箱:

git commit --amend --author='Your Name <you@example.com>'

查看配置信息:

git config --list

更多配置,查看git config官方配置文档

配置http密码:https://www.kernel.org/pub/software/scm/git/docs/git-credential-store.html

查看日志git log

git config(转载)的更多相关文章

  1. git (转载)

    文章转载 一:Git是什么? Git是目前世界上最先进的分布式版本控制系统. 二:SVN与Git的最主要的区别? SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是自己的 ...

  2. git config 介绍

    转载. https://blog.csdn.net/liuxiao723846/article/details/83113317 Git的三个重要配置文件分别是/etc/gitconfig,${HOM ...

  3. 一个小时学会Git(转载)

    ---恢复内容开始--- 一个小时学会Git     最近要与部门同事一起做技术分享,我选择了Git,因为Git 是一种在全球范围都广受欢迎的版本控制系统.在开发过程中,为了跟踪代码,文档,项目等信息 ...

  4. git config 配置

    1. git config简介 我们知道config是配置的意思,那么git config命令就是对git进行一些配置.而配置一般都是写在配置文件里面,那么git的配置文件在哪里呢?互动一下,先问下大 ...

  5. 学习git config配置文件

    设置 git status的颜色. git config --global color.status auto 一.Git已经在你的系统中了,你会做一些事情来客户化你的Git环境.你只需要做这些设置一 ...

  6. git submodule(转载)

    From:http://www.worldhello.net/2010/01/26/425.html 删除 git submodule (git 库子模组) 有两种情况会创建 git submodul ...

  7. git config命令使用

    1. git config简介 我们知道config是配置的意思,那么git config命令就是对git进行一些配置.而配置一般都是写在配置文件里面,那么git的配置文件在哪里呢?互动一下,先问下大 ...

  8. git config --global core.autocrlf false

    git config --global core.autocrlf  false warning: LF will be replaced by CRLF in .idea/vcs.xml.The f ...

  9. [译]git config

    git config git config命令用来设置git的一些配置(包括全局配置和针对单个仓储的配置).git config命令能定义一个仓储的用户信息和用户偏好. 用法 git config u ...

随机推荐

  1. 【转】iOS静态库 【.a 和framework】【超详细】

    原文网址:https://my.oschina.net/kaqijiang/blog/649632 一.什么是库? 库是共享程序代码的方式. 库从本质上来说是一种可执行代码的二进制格式,可以被载入内存 ...

  2. (转) Lua string 操作函数

    本文转自: http://www.cnblogs.com/newlist/p/3649388.html table.keys 返回指定表格中的所有键. 格式: keys = table.keys(表格 ...

  3. LUA_linux的安装

    安装 进入官方站点(http://www.lua.org/download.html )下载最新的安装包.当前是 Lua 5.2.0 wget -c http://www.lua.org/ftp/lu ...

  4. DYNAMIC_DOWNCAST、STATIC_DOWNCAST、CRuntimeClass和IsKindOf

    DYNAMIC_DOWNCAST.STATIC_DOWNCAST.CRuntimeClass和IsKindOf   DYNAMIC_DOWNCAST(class, pointer ):如果pointe ...

  5. Xcode 7安装KSImageNamed失败解决方法

    ## How do I use it? Build the KSImageNamed target in the Xcode project and the plug-in will automati ...

  6. 二十四种设计模式:组合模式(Composite Pattern)

    组合模式(Composite Pattern) 介绍将对象组合成树形结构以表示"部分-整体"的层次结构.它使得客户对单个对象和复合对象的使用具有一致性.示例有一个Message实体 ...

  7. 虚拟化之esxi命令行管理之二

    /vmfs # ls -l lrwxrwxrwx 1 root root 4 Mar 23 2013 devices -> /dev drwxr-xr-x 1 root root 512 Sep ...

  8. [Hibernate] - one to many

    事实上one to many 和 many to one是一样的,这是一个相互的过程. hibernate.cfg.xml <?xml version="1.0" encod ...

  9. Struts2 - 传值

    Struts2传值有几种方式: 1)URL parameter 例如配置代码: <action name="login_*" class="com.my.actio ...

  10. Servlet Listener

    需要继承ServletContextListener接口. 代码: package com.my; import java.io.*; import javax.servlet.*; import j ...