`
wbj0110
  • 浏览: 1587855 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

How to Install Git on Ubuntu 12.04

    博客分类:
  • Git
阅读更多

How to Install Git on Ubuntu 12.04

About Git


Git is a distributed version control system released to the public in 2005. The program allows for non-linear development of projects, and can handle large amounts of data effectively by storing it on the local server.

This tutorial will cover two ways to install Git.

How to Install Git with Apt-Get


Installing Git with apt-get is a quick and easy process. The program installs on the virtual private server with one command:

sudo apt-get install git


After it finishes downloading, you will have Git installed and ready to use.

How to Install Git from Source


If you are eager to download the most recent version of Git, it is generally a good idea to install it from the source.

Quickly run apt-get update to make sure that you download the most recent packages to your VPS.

sudo apt-get update


Prior to installing Git itself, download all of the required dependancies:

sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential


Once they are installed, you can download the latest version of Git from the google code page.

wget http://git-core.googlecode.com/files/git-1.7.12.rc2.tar.gz


After it downloads, untar the file and switch into that directory:

tar -zxf git-1.7.12.rc2.tar.gz
cd git-1.7.12.rc2


If you want to do a global install, install it once as yourself and once as root, using the sudo prefix:

make prefix=/usr/local all
sudo make prefix=/usr/local install


If you need to update Git in the future, you can use Git itself to do it.

git clone git://git.kernel.org/pub/scm/git/git.git

 

How to Setup Git


After Git is installed, whether from apt-get or from the source, you need to copy your username and email in the gitconfig file. You can access this file at ~/.gitconfig.

Opening it following a fresh Git install would reveal a completely blank page:

sudo nano ~/.gitconfig


You can use the follow commands to add in the required information.

git config --global user.name "NewUser"
git config --global user.email newuser@example.com


You can see all of your settings with this command:

git config --list


If you avoid putting in your username and email, git will later attempt to fill it in for you, and you may end up with a message like this:

[master 0d9d21d] initial project version
 Committer: root 
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author
分享到:
评论

相关推荐

    ubuntu12.04 git服务器的搭建

    在ubuntu 12.04 上完成的git服务器搭建步骤。

    ubuntu 12.04 使用手册1—4

    《Ubuntu 12.04 使用手册1—4》是一套专为Ubuntu 12.04 LTS(长期支持版)用户编写的详尽指南,旨在帮助初学者和进阶用户掌握这一开源操作系统的基本操作与高级技巧。Ubuntu 12.04,代号“Precise Pangolin”,是...

    学习ubuntu12.04入门指南

    《学习Ubuntu 12.04入门指南》是一份针对初学者的详尽教程,旨在帮助用户熟悉并掌握Ubuntu 12.04 LTS(长期支持版)操作系统的基础操作和特性。Ubuntu是基于Linux内核的开源操作系统,以其用户友好、易用性和强大的...

    ubuntu12.04最新学习资料

    Ubuntu 12.04,代号为"precise pangolin",是Ubuntu操作系统的一个长期支持(LTS)版本,发布于2012年,提供了长达5年的技术支持,直至2017年。这个版本引入了许多改进和新特性,旨在提供一个稳定、安全且用户友好的...

    Ubuntu 12.04 precise source/源

    标题 "Ubuntu 12.04 precise source/源" 指的是Ubuntu 12.04 LTS(长期支持版)中的源代码仓库或者源列表。这个版本的Ubuntu,代号为“precise pangolin”,发布于2012年,并提供支持直到2017年。在Linux操作系统中...

    LTIB在Ubuntu12.04下的安装参考

    在本教程中,我们将深入探讨如何在Ubuntu 12.04 LTS (Precise Pangolin) 上安装和配置LTIB,因为这是相对较少被详细讨论的版本。 首先,我们需要确保系统满足LTIB的基本要求。Ubuntu 12.04 应该已经预装了许多必要...

    ubuntu12.04LTS视频安装教程[标清版].rar

    《Ubuntu 12.04 LTS 视频安装教程详解》 Ubuntu 12.04 LTS(长期支持版)是Ubuntu操作系统的一个重要版本,它以其稳定性和长期的技术支持受到用户的广泛欢迎。对于初次接触Linux或者想要从Windows、Mac OS等其他...

    Ubuntu 12.04 64位编译cm-10.2 总结

    标题“Ubuntu 12.04 64位编译cm-10.2 总结”涉及到的是在Ubuntu 12.04 LTS(长期支持版)64位操作系统上编译CyanogenMod(CM)10.2的过程。CyanogenMod是一个基于Android开源项目的第三方操作系统,CM 10.2是针对...

    零分下载:Ubuntu 12.04 菜鸟使用手册1~3

    《Ubuntu 12.04 菜鸟使用手册1~3》是针对初学者的一份详尽指南,旨在帮助用户快速上手Ubuntu 12.04操作系统。Ubuntu是基于Linux内核的开源操作系统,因其易用性、稳定性和安全性而广受欢迎。这份手册深入浅出地讲解...

    linux-0.11源代码,是在ubuntu12.04不断编译修错得到的代码文件

    在Ubuntu 12.04(Precise Pangolin)上编译和修复错误的过程,不仅涉及到了对源代码的深入理解,还涵盖了操作系统开发、编译工具链和调试技术等多个方面。 1. **Linux内核结构**:Linux-0.11源代码展示了早期内核的...

    Ubuntu12.04通过命令安装vim及配置文件

    在Ubuntu 12.04操作系统中,Vim(Vi Improved)是一款强大的文本编辑器,深受程序员和系统管理员的喜爱。它的功能丰富,可扩展性强,支持语法高亮、代码补全等特性,使得代码编辑效率大大提升。本教程将详细介绍如何...

    安装Ubuntu 12.04 和下载编译Android R10.4源码1

    在本文中,我们将详细介绍如何在Ubuntu 12.04 LTS 64位系统上安装环境,以便编译Android R10.4的源码。首先,我们需要确保系统是最新的,然后安装必要的软件包和依赖项。 第一步是安装Ubuntu 12.04 LTS。在VMware ...

    ubuntu 12.04 gstremer的开发环境代价!

    在Ubuntu 12.04上安装GStreamer的源代码包,你需要下载GStreamer的最新版本或者特定版本的源代码,这可以通过访问GStreamer的官方网站或者使用Git克隆其仓库来实现。源代码包提供了对软件内部结构的深入理解,允许...

    Ubuntu 12.04 32bit linux 的 adb 安装包

    Ubuntu 12.04 32bit linux 的 adb 安装包, 安装方法,下载后,在命令行执行如下语句 sudo dpkg -i android-tools-adb_4.2.2+git20130529-5.1_i386.deb

    Ubuntu-12.04-Server-amd64-git-gitolite安装.docx

    在本文中,我们将深入探讨如何在Ubuntu 12.04服务器上安装Git以及与之相关的gitolite工具,这是一个用于管理和控制Git仓库的强大系统。首先,我们将介绍如何使用包管理器安装Git,接着设置SSH访问,最后我们将详细...

    ubuntu12.04安装OpenCV2.4.1.pdf

    ### 关于Ubuntu 12.04安装OpenCV 2.4.1的知识点 #### 一、前言 在本篇文章中,我们将详细介绍如何在Ubuntu 12.04系统上安装OpenCV 2.4.1版本。OpenCV(Open Source Computer Vision Library)是一个开源的计算机...

    ubuntu12.04编译android4.1.1_r6源代码步骤.docx

    ### Ubuntu 12.04 编译 Android 4.1.1_r6 源代码步骤 #### 硬件及操作系统环境 - **CPU**: Intel® Core™ i3-2310M CPU @2.10GHz × 4 - **内存**: 4GB - **硬盘**: 100GB - **操作系统**: Ubuntu 12.04 (64-bit) ...

    Ubuntu12.04下交叉编译VLC-2.1.1-Win32程序的说明

    在本文中,我们将详细探讨如何在Ubuntu 12.04环境下进行VLC-2.1.1的交叉编译,以生成适用于Windows 32位系统的程序。这个过程涉及到安装必要的工具,设置编译环境,以及配置和编译源代码。 首先,交叉编译是在一个...

    在Ubuntu12.04-32位操作系统下编译linphone-android.doc

    在Ubuntu 12.04-32位操作系统下编译Linphone-Android涉及一系列步骤,包括环境配置、源码获取、依赖安装以及编译构建。以下是对这些知识点的详细说明: 1. **Ubuntu 12.04-32位操作系统**: 选择32位Ubuntu系统是...

    ubuntu 12.04上安装nox控制器.docx

    在Ubuntu 12.04系统上安装NOX控制器是一个涉及多步骤的过程,主要用于搭建OpenFlow网络环境。NOX(Network Operating System)是一款强大的、可编程的网络操作系统,它允许开发人员通过高级语言来控制网络设备,如...

Global site tag (gtag.js) - Google Analytics