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

How to Install Git from Source

阅读更多

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

 

See More


This tutorial covered how to install Git on your virtual private server. Stay tuned for a second tutorial on Git Basics. 

分享到:
评论

相关推荐

    A tour of git_the basics

    it’s difficult to give a comprehensive set of instructions on how to install git binaries. The version of git that you will end up with can vary depending on how active the person is who maintains ...

    Git.for.Teams.1491911182

    But unlike just about every other book written about Git, it doesn’t start with how to install the software and create your first repository. Instead, this book starts with a 10,000ft view of a ...

    Jump.Start.Git.0994182651

    See how Git's used effectively on large open-source projects. Git was created by Linus Torvalds, who invented Linux, so it comes with the best credentials. What are you waiting for? Get a jump start ...

    git-relocate:在 git repo 中移动完整子树的实用程序

    git-relocate 在 git repo 中移动或克隆完整子树的实用程序 克隆 repo 后,只需运行: mvn install 这将在您的全局 git 配置中创建一个 git 别名。 usage: git relocate ...These flags specify how to handle

    Drupal.8.for.Absolute.Beginners.1430264667

    The book also covers some more advanced topics that beginners often ask about, such as getting set up with Git and using source control, using MySQL to interact with a database, and a guide to ...

    Moodle.3.Administration.3rd.Edition.1783289716

    Install and update Moodle on multiple platforms manually and via CLI and GIT Manage courses and categories, users and cohorts, as well as roles Get Moodle hooked up to repositories, portfolios, and ...

    Qt5 3D官方教程配套示例代码

    Read on to discover how the building of packages works. This section is also important if you want to change how the structure of the Qt3D pro files work. To build Qt3D, run: qmake && make The ....

    GitLab Cookbook

    Along with covering some of the basic principles of Git, the book covers practical scenarios to show how you or your organization can effectively manage your proprietary code., You will learn how to ...

    html2canvas

    Skip lint and tests and simply build from source: $ grunt build Running tests The library has two sets of tests. The first set is a number of qunit tests that check that different values parsed by ...

    [Go语言入门(含源码)] The Way to Go (with source code)

    The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface......................

    livestream-gatsby-themes:演示如何构建Gatsby主题,子主题和使用主题的网站的源代码-How to use the source code

    如何建立盖茨比主题 此存储库包含使用的网站的源代码...# Install dependencies yarn # Start the site on http://localhost:8000 yarn workspace site develop 如果这是您第一次使用Yarn工作区, 。 链接和进一步阅读

    ethminer-0.16.0.dev3

    Check our [samples](POOL_EXAMPLES_ETH.md) to see how to connect to different pools. ## Build ### Continuous Integration and development builds | CI | OS | Status | Development builds | | ----------...

    freedomhood:Free Freedomhood网站的源代码-Free website source code

    $ brew nvm info # follow the instructions on how to properly install nvm 以上步骤已通过 (适用于macOS或Linux的软件包管理器)进行了测试,如果您使用的是其他操作系统,请考虑使用其他替代方法来安装例如 。...

    Customize-IBus:Full customization of appearance, behavior, system tray and input source indicator for IBus. (深度定制 IBus 的外观、行为、系统托盘以及输入指示)

    安装 或手动: git clone https://github.com/openSUSE/Customize-IBus.gitcd Customize-IBus && make install 如果你使用 Arch Linux,你也可以使用 AUR 作为系统扩展安装: yay -S gnome-shell-extension-...

    debug_scrapy:调试scrapy核心源代码并阅读

    This repository is about how to debug scrapy core source code and read it . (注:此repo是从scrapy源码中抽离出来的scrapy目录,并对大多数代码做了翻译解读,仅供阅读参考,如果有不正确的地方欢迎讨论。小弟...

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

    drools-distribution-7.10.0.Final

    But to build from sources, pull the sources with git: https://github.com/kiegroup and follow these instructions: https://github.com/kiegroup/droolsjbpm-build-bootstrap/blob/master/README.md 欢迎...

    China-Districts:制作中国地区的JSON树

    How to use? npm install china-districts var chinaDistricts = require('china-districts'); console.log(chinaDistricts); Contribution $ git clone https://github.com/Leask/China-Districts.git # update the...

    Matplotlib.pdf

    2.2 Installing from source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Build requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

Global site tag (gtag.js) - Google Analytics