Report this

What is the reason for this report?

Como instalar o Git no Ubuntu 18.04 [Início rápido]

Published on November 7, 2019
Português
Como instalar o Git no Ubuntu 18.04 [Início rápido]

Introdução

Os sistemas de controle de versão ajudam a compartilhar e colaborar em projetos de desenvolvimento de software. O Git é um dos sistemas de controle de versão mais populares disponíveis atualmente.

Este tutorial irá mostrar como instalar e configurar o Git em um servidor Ubuntu 18.04. Para uma versão mais detalhada deste tutorial, contendo explicações mais completas para cada etapa, consulte Como instalar o Git no Ubuntu 18.04.

Passo 1 — Como atualizar os pacotes padrão

Estando logado no servidor Ubuntu 18.04, como um usuário sudo não-root, atualize primeiro seus pacotes padrão.

  1. sudo apt update

Passo 2 — Instale o Git

  1. sudo apt install git

Passo 3 — Como confirmar a instalação bem sucedida

É possível confirmar que sua instalação está funcionando corretamente ao executar este comando e receber a saída similar ao seguinte:

  1. git --version
Output
git version 2.17.1

Passo 4 — Como configurar o Git

Agora que você tem o Git instalado, para prevenir avisos, você deve configurá-lo com as suas informações.

  1. git config --global user.name "Your Name"
  2. git config --global user.email "youremail@domain.com"

Se for necessário editar este arquivo, será possível usar um editor de texto como o nano:

  1. nano ~/.gitconfig
~/.gitconfig contents
[user]
  name = Your Name
  email = youremail@domain.com

Tutoriais relacionados

Alguns links para tutoriais mais detalhados relacionados a este guia:

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Lisa Tagliaferri
Lisa Tagliaferri
Author
See author profile

Community and Developer Education expert. Former Senior Manager, Community at DigitalOcean. Focused on topics including Ubuntu 22.04, Ubuntu 20.04, Python, Django, and more.

Still looking for an answer?

Was this helpful?
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.