git学习一 基于linux ubuntu git安装与配置
2011-07-04 22:25
831 查看
1.安装git
># sudo apt-get build-dep git-core git-doc
这个会安装git-core和git-doc依赖的库。
接下来去官网下载git的源码包。把下载的git包解压。
在解压的目录下执行下列的命令来编译git
>#make prefix=/usr/local all doc
然后需要安装git
>#sudo make install install install-doc
这样你的git就可以被该计算机上的所有用户使用了。
你可以使用下面的命令来查看自己的git版本号。
>#git --version
2.配置git
由于git并不像svn那样有中心仓库,所以并不需要想中心仓库提供用户名和密码等。但是我们还是需要告诉
要通过用户名和email地址来给git传递一些信息。这些信息通常被设置为global。这里必须设置的两个是user.name
和user.email。user.name是提交代码时显示的名称,user.email可以被其他开发者用于联系你使用。
>#git config --global user.name "your name"
>#git config --global user.email "youraddr@xxx.com"
然后我们可以通过下面的命令来查看是否修改成功了呢。
>#git config --global --list
我们应该会看到我们刚才配置的信息。
除此之外,还可以调整git的显示颜色来区分不同的变化。
>#git config --global color.ui "auto"
3.查看git帮助
>#git help
命令可以查看git的命令
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
如果想查看git的具体命令使用可以通过下面命令做到,例如查看clone命令。
>#git help clone
到这我们已经配置好我们的git了,接下来就可以创建我们的工程了。明天接着写哟。
># sudo apt-get build-dep git-core git-doc
这个会安装git-core和git-doc依赖的库。
接下来去官网下载git的源码包。把下载的git包解压。
在解压的目录下执行下列的命令来编译git
>#make prefix=/usr/local all doc
然后需要安装git
>#sudo make install install install-doc
这样你的git就可以被该计算机上的所有用户使用了。
你可以使用下面的命令来查看自己的git版本号。
>#git --version
2.配置git
由于git并不像svn那样有中心仓库,所以并不需要想中心仓库提供用户名和密码等。但是我们还是需要告诉
要通过用户名和email地址来给git传递一些信息。这些信息通常被设置为global。这里必须设置的两个是user.name
和user.email。user.name是提交代码时显示的名称,user.email可以被其他开发者用于联系你使用。
>#git config --global user.name "your name"
>#git config --global user.email "youraddr@xxx.com"
然后我们可以通过下面的命令来查看是否修改成功了呢。
>#git config --global --list
我们应该会看到我们刚才配置的信息。
除此之外,还可以调整git的显示颜色来区分不同的变化。
>#git config --global color.ui "auto"
3.查看git帮助
>#git help
命令可以查看git的命令
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
如果想查看git的具体命令使用可以通过下面命令做到,例如查看clone命令。
>#git help clone
到这我们已经配置好我们的git了,接下来就可以创建我们的工程了。明天接着写哟。
相关文章推荐
- git学习一 基于linux ubuntu git安装与配置
- 20155228 基于VirtualBox安装Ubuntu和学习linux命令的学习经历和心得
- 超简单!Linux下FTP服务器的安装和配置(基于Ubuntu)
- ROS学习(基于Ubuntu 15.04 和ROS Jade)第三章 ROS核心教程 之 1 安装和配置你的ROS环境
- Git学习随笔---Ubuntu下安装和配置
- Git使用:Linux(Ubuntu 14.04 x64)下安装Git并配置连接GitHub
- 在Linux上git的安装,基于系统Ubuntu16
- Git使用:Linux(Ubuntu 14.04 x64)下安装Git并配置连接GitHub
- [Linux学习日记]Ubuntu 9.10的安装和初步配置
- [Linux]Ubuntu 12.04.3下安装与配置Git Server——gitolite
- 玩玩Linux云主机-安装redis,redis学习,Ubuntu 安装redis 配置文件路径
- Caffe_Linux学习笔记(一)基于Ubuntu16.04+CPU only+Python2.7环境下的Caffe配置
- Ubuntu 16.04 linux环境下 Intellij DEA安装及配置maven
- RTEMS 最新基于ubuntu和RSB编译环境的安装配置
- Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
- Linux学习-Ubuntu安装和卸载字体
- linux下ubuntu系统安装及开发环境配置
- Hadoop — Linux(Ubuntu15.04)下安装`配置Hadoop(2.6.0)
- Linux(ubuntu)下java的安装和配置
- 基于Ubuntu 10.10的最新版fcitx小企鹅输入法的安装配置