安装

在Fedora/CentOS下安装

$ sudo yum install git

在Debian/Ubuntu Linux下载安装

$ sudo apt-get install git

Windows/Mac下要先下载,下载地址https://git-scm.com/downloads

在gui环境下安装,安装过程略。

设置环境变量

1
2
3
4
5
6
$ git config --global user.name "wsh"
$ git config --global user.email "tech@wangshenghua.com"
$ git config --global push.default simple
$ git config --global color.ui.auto
$ git config --global color.branch auto
$ git config --global color.status auto

$ git config --global user.name "wsh"   设置用户名

$ git config --global user.email "tech@wangshenghua.com"  设置email

$ git config --global push.default simple 设置工作流程模式

simple表示在中央仓库工作流程模式下,拒绝推送到上游与本地分支名字不同的分支。也就是只有本地分支名和上游分支名字一致才可以推送,就算是推送到不是拉取数据的远程仓库,只要名字相同也是可以的。在git 2.0中,simple将会是push.default的默认值。

$ git config --global color.ui.auto      设置ui颜色自动高亮
$ git config --global color.branch auto  设置分支颜色自动高亮
$ git config --global color.status auto 设置状态颜色自动高亮

查看设置的环境变量

$ git config --list

 

Git 配置环境的更多相关文章

  1. Git 配置环境及常用命令整理

    一.Git教程网站 廖雪峰网站 易百GitHub命令:https://www.yiibai.com/git/git_clone.html 完成Windows环境命令下Git config配置 设置好之 ...

  2. Android源码浅析(二)——Ubuntu Root,Git,VMware Tools,安装输入法,主题美化,Dock,安装JDK和配置环境

    Android源码浅析(二)--Ubuntu Root,Git,VMware Tools,安装输入法,主题美化,Dock,安装JDK和配置环境 接着上篇,上片主要是介绍了一些安装工具的小知识点Andr ...

  3. git之win安装git和环境配置及常用命令总结

    12.windowns安装git和环境变量配置 11.git之常见命令总结 ===== 12.windowns安装git和环境变量配置 ; 转自 https://wuzhuti.cn/2385.htm ...

  4. windows环境下git的环境变量配置

    1.从官网下载git这个软件.msi格式,然后安装. 2.找到你的git的安装目录,并记录下来 3.配置环境变量:在path里加入——  ;你的git的安装目录\bin;你的git的安装目录\libe ...

  5. Windows环境下Git配置及使用

    Windows环境下Git配置及使用 一.安装包位置 Git下载地址https://git-scm.com/download/win TortoiseGit下载地址https://tortoisegi ...

  6. Git 工作环境配置

    Git config 简单介绍 Git的配置选项有:-system,-global 和 -local. ① system:系统级别的全局设置,对所有电脑用户生效,文件在/etc/gitconfig: ...

  7. Jenkins+Maven+Git CI环境搭建手册

    Jenkins+Maven+Git CI环境搭建手册 环境: OS:Linux version 2.6.32-220.23.2.ali878.el6.x86_64 (ads@kbuild) (gcc ...

  8. Linux下基于HTTP协议带用户认证的GIT开发环境设置

    Git 的访问可以采用 HTTP 或 SSH 协议安全的访问,通常我们使用 gitlib 进行 Web 管理,但是在 Linux 命令行开发环境下,基本都是使用 SSH 协议,只需要在 gitlib ...

  9. 1 起步-Pro Git---VCS比较、git基本原理、git配置

    本地版本控制系统 集中化的版本控制系统 诸如 CVS,Subversion 以及 Perforce 等,都有一个单一的集中管理的服务器,保存所有文件的修订版本,而协同工作的人们都通过客户端连到这台服务 ...

随机推荐

  1. set_multiset_functor

    #include<iostream> #include<string> #include<set> using namespace std; class Stude ...

  2. PureComponent & shouldComponentUpdate

    Called to determine whether the change in props and state should trigger a re-render. Component alwa ...

  3. React Core Features

    React Core Features Here is a summary of the core features. We will cover each feature in detail thr ...

  4. Docker报错“Dockerfile parse error line 1: FROM requires either one or three arguments”

    看官方文档Format: 以 '#' 开头一行被视为评论,出现在其他位置视为参数. 也就不难理解报错原因:将写在同一行的注释视为参数了. 原Dockerfile: 改为:

  5. gcc 编译c++文件

    #include <stdio.h> //将类定义在命名空间中 namespace Diy{ class Student{ public: char *name; int age; flo ...

  6. Kubernetes中如何让Deployment更新镜像

    问题描述 我的deployment有单个pod,我的自定义docker镜像如下: 123 containers: - name: mycontainer image: myimage:latest 在 ...

  7. 数据结构Java版之基数排序(四)

    基数排序: 基数排序分为两种:第一种是LSD ,从最低位开始排序, 第二种是 MSD 从最高位开始排.这里介绍第一种LSD排序算法. 首先,我们先了解什么是基数.基数是根据具体的排序情况而定的,比如我 ...

  8. js函数如何传递多个参数

    应用场景: 需要根据多个参数来判断该数据所属,从而达到删除或者修改的目的. 比如删除区域下的分组,一个区域可以用多个分组,不同的区域可以有相同的分组,那么如何识别对应的分组呢??? 可以在对应的数据操 ...

  9. KAFKA && zookeeper 集群安装

    服务器:#vim /etc/hosts10.16.166.90 sh-xxx-xxx-xxx-online-0110.16.168.220 sh-xx-xxx-xxx-online-0210.16.1 ...

  10. 关于python的四舍五入

    参考https://blog.csdn.net/qq_39234705/article/details/82817703 四舍五入有很多相关资料,主要用两种方法round()和'%.2f' 两种方法取 ...