Skip to content

Instantly share code, notes, and snippets.

@sandyxu
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sandyxu/b8e76c1acf805ed3577b to your computer and use it in GitHub Desktop.
Save sandyxu/b8e76c1acf805ed3577b to your computer and use it in GitHub Desktop.
git command description

Git 安装与初始化

Linux

如果你用的是Linux,你可以用你的本地包管理系统(native package management system)来安装.

$ yum install git-core  #译者注,在redhat等系统下用yum

$ apt-get install git-core  #译者注,在debian, ubuntu等系统下用apt-get

MACOS

可以通过MacPorts命令来安装:

$ sudo port install git-core

或通过brew 命令

$ brew install git-core

Windows

在Windows下安装Git是很简单的,你只要下载msysGit就可以了。

喜欢界面的推荐列表: GUI Clients

Git 配置

使用Git的第一件事就是设置你的名字和email,这些就是你在提交commit时的签名。

$ git config --global user.name "Xu Chao"
$ git config --global user.email "jyosuper@gmail.com"

这样的设置是全局设置,会影响此用户建立的每个项目.

执行了上面的命令后,会在你的主目录(home directory)建立一个叫 ~/.gitconfig 的文件. 内容一般像下面这样:

[user]
  name = Xu Chao
  email = jyosuper@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment