`
zhb8015
  • 浏览: 376827 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
Group-logo
Spring Roo杂谈
浏览量:0
社区版块
存档分类
最新评论

how to install git on ubuntu

阅读更多

What the Red Means

The lines that the user needs to enter or customize will be in red in this tutorial! The rest should mostly be copy-and-pastable.

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-core

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 https://git-core.googlecode.com/files/git-1.8.1.2.tar.gz

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

tar -zxf git-1.8.1.2.tar.gz
cd git-1.8.1.2

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 <root@droplet1.(none)>
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
分享到:
评论

相关推荐

    deepspeech-demo:Mozillas DeepSpeech项目的演示应用程序

    如果您不知道如何how to install SoX on (windows|ubuntu|mac)至少对我来说如此),则可以快速了解how to install SoX on (windows|ubuntu|mac) 。 安装 首先,克隆存储库: git clone git@github....

    how-to-install-a-linux-development-environment-on-windows:如何使用Ubuntu和WSL2在Windows上安装Linux开发环境

    配置git忽略文件模式更改 结论 关于作者 为什么是本指南 本指南供熟悉Linux和Unix环境的人们使用WSL2和Ubuntu在Windows上创建开发环境。 我不在Microsoft或Canonical工作-我开发Web应用程序,在此之前是Linux管理...

    kmd_ntx_stats_docker:使用Django PGSQL的Komodo Notary stats API的Docker容器

    ://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04 码头工人: : Docker Compose: : Certbot: ://certbot.eff.org/lets-encrypt/ubuntubionic-nginx.html git: sudo apt ...

    Linux: Powerful Server Administration

    Get hands-on recipes to make the most of Ubuntu Server, CentOS 7 Linux Server and RHEL 7 Server About This Book Get Linux servers up and running in seconds, In-depth guide to explore new features and...

    ethminer-0.16.0.dev3

    on Ubuntu run: ```sh sudo apt-get install mesa-common-dev ``` #### Disable Hunter If you want to install dependencies yourself or use system package manager you can disable Hunter by adding [-...

    card-crnn-ctpn:CTPN + CRNN银行卡号识别(数据测试图片累计约90%)

    HOW TO USE setup 环境配置 Ubuntu18.04 + CUDA 8.0.61 + GeForce GTX 960M + NVIDIA Driver 430.14 + Python3.6 + Tensorflow-gpu git clone https://github.com/bay1/card-crnn-ctpn.git python3 -m virtualenv ...

    树莓派LCD驱动

    How to Install: 1.)Step1, Install Raspbian official mirror a)Download Raspbian official mirror: https://www.raspberrypi.org/downloads/ b)Use“SDFormatter.exe”to Format your TF Card c)Use“Win32Disk...

    odotdot:有趣的编程语言

    例如,如果您使用的是基于DebianLinux发行版(如Ubuntu或Mint),请运行以下命令: $ sudo apt install gcc make git libreadline-dev您不需要安装libreadline-dev ,但是如果您安装了libreadline-dev ,则交互式R

    Open-Knesset:**官方仓库位于https

    Linux 安装初始要求(因为我们要将PIL编译到环境中,所以我们还需要开发工具): Debian及其衍生产品,例如Ubuntu和Mint sudo apt-get install build-essential git python python-dev python-setuptools python-...

    java8源码-Hebe-Block:白块

    `http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html` - *FreeBSD* - `pkg install openjdk8` - *CentOS - `yum install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64` ...

    java8源码-ngp:从NXT区块链克隆,v1.11.5

    `http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html` - *FreeBSD* - `pkg install openjdk8` - *CentOS - `yum install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64` ...

    nxt:用于 NXTcoin 开发的 Ziftr 存储库

    欢迎来到 Nxt! 什么是NXT? ... 使用 Nxt,您可以管理和交互 你的资产 你的生意 ... Debian - http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html 存储库- git clone https://b

    nxt:为 MofoWallet 扩展 NXT

    欢迎来到 Nxt! 什么是NXT? ... 使用 Nxt,您可以管理和交互 你的资产 你的生意 ... Debian - http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html 存储库- git clone https://b

    ExamWeb

    克隆:git clone 您需要为WSL安装nodejs和npm 请参考链接: 节点: : npm: ://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04 然后,您需要检查所有库设置。 在每个文件夹的...

Global site tag (gtag.js) - Google Analytics