Install and Configure git
来源:互联网 发布:万达电影网络院线 编辑:程序博客网 时间:2024/05/21 22:32
抛开服务器、帐户、SSH、读写权限等等干扰,在本地相对安全的实现一个干净清洁的 Git 使用环境。 安装Git程序,或者到新立得软件包里面 输入 git然后安装。 一般在新的系统上,我们都需要先配置下自己的 Git 工作环境。配置工作只需一次,以后升级时还会沿用现在的配置。当然,如果需要,你随时可以用相同的命令修改已有的配置。 Git 提供了一个叫做 git config 的工具(译注:实际是 git-config 命令,只不过可以通过 git 加一个名字来呼叫此命令。),专门用来配置或读取相应的工作环境变量。而正是由这些环境变量,决定了 Git在各个环节的具体工作方式和行为。这些变量可以存放在以下三个不同的地方: 第一个要配置的是你个人的用户名称和电子邮件地址。这两条配置很重要,每次 Git 提交时都会引用这两条信息,说明是谁提交了更新,所以会随更新内容一起被永久纳入历史记录: 如果用了 –global 选项,那么更改的配置文件就是位于你用户主目录下的那个,以后你所有的项目都会默认使用这里配置的用户信息。如果要在某个特定的项目中使用其他名字或者电邮,只要去掉 –global 选项重新配置即可,新的设定保存在当前项目的 .git/config 文件里。 接下来要设置的是默认使用的文本编辑器。Git 需要你输入一些额外消息的时候,会自动调用一个外部文本编辑器给你用。默认会使用操作系统指定的默认编辑器,一般可能会是 Vi 或者 Vim。如果你有其他偏好,比如 Emacs 的话,可以重新设置: 还有一个比较常用的是,在解决合并冲突时使用哪种差异分析工具。比如要改用 vimdiff 的话: Git 可以理解 kdiff3,tkdiff,meld,xxdiff,emerge,vimdiff,gvimdiff,ecmerge,和 opendiff 等合并工具的输出信息。当然,你也可以指定使用自己开发的工具。 要检查已有的配置信息,可以使用 git config –list 命令: 有时候会看到重复的变量名,那就说明它们来自不同的配置文件(比如 /etc/gitconfig 和 ~/.gitconfig),不过最终 Git 实际采用的是最后一个。 想了解 Git 的各式工具该怎么用,可以阅读它们的使用帮助,方法有三: 比如,要学习 config 命令可以怎么用,运行: 我们随时都可以浏览这些帮助信息而无需连网。本地安装
sudo apt-get install git-core
初次运行 Git 前的配置
用户信息
$ git config --global user.name "Your Name Comes Here"$ git config --global user.email you@pub.admon.org
文本编辑器
$ git config --global core.editor emacs
差异分析工具
$ git config --global merge.tool vimdiff
查看配置信息
$ git config --listuser.name=Scott Chaconuser.email=schacon@gmail.comcolor.status=autocolor.branch=autocolor.interactive=autocolor.diff=auto...
获取帮助
$ git help <verb>$ git <verb> --help$ man git-<verb>
$ git help config
- Install and Configure git
- git gitlab server install and configure
- install and configure git on Windows,Ubuntu,Mac
- Install and Configure ASM
- install and configure subversion
- install and configure postgresql
- docker install and configure
- ubuntu QT install and configure
- [CI]Install and Configure Hudson
- [Linux]Install And Configure Trac
- Kamailio (OpenSER) install and configure
- fontconfig configure compile and install
- install MinGW and git
- How to install and configure bugzilla
- How To: Install and Configure GitWeb
- [MySQL]Install and Configure MySQL in Ubuntu
- Install and Configure Edge Transport Role
- Install and Configure JRebel for MyEclipse
- SPOOL参数详解
- PHP 字符串
- Jetty vs Tomcat: A Comparative Analysis
- ISAPI配置
- 计算执行sql耗时
- Install and Configure git
- 俺发现这是个好地方~
- VS中使用VC资源编辑器添加变量或事件处理程序出现脚本错误的解决办法
- PHP 运算符
- 证券基础知识——与bond相关的几个知识点discount factor,Spot rates,forward rates
- 编码
- PHP If...Else 语句
- 一般算des mac的方法
- [转]s3c2440 lcd驱动学习笔记