image

Acesse bootcamps ilimitados e +650 cursos pra sempre

60
%OFF
Article image
Eric Ricielle
Eric Ricielle31/12/2023 13:52
Compartilhe

Configuração GIT in CLI

    Get started with Git in the local CLI (pt-Br version in the next section)

    Hi DIO community,

    Firstly, thank you for reserving your time for reading this tutorial. I've been learning English yet, so sorry for any syntax errors.

    Let's learn how to realize the initial configuration of Git via CLI so that you can make your commits and push more quickly.

    1 - In the first step, is necessary to create an account in the Git platform. Below, you can see the respective link:

    https://github.com/

    2 - After the account is created, we going to download Git, through the link below:

    https://git-scm.com/downloads

    After downloading the Git, make the app installation and choose all default options. The procedure is automated.

    3 - Now, after installing Git, you have access to the CLI yet, through the option “Bash CLI”. You can this option into any directory system, just clicking with the right button of the mouse.

    When accessing the terminal CLI, the next step is to create the key with reference to your email:

    # ssh-keygen -t ed25519 -C youremail@mail.com

    Important: Remember the way of the directory that this key where created. 

    4 - After the key is created, let’s look at your content (remember the path where the key where created and access it)

    Tip: You have 2 ways to access the path where the key where created. First, you can go to the respective path just using the command “cd” and putting the respective path. You can also go to the respective directory just using the manager files of your operational system.

    Below, is the command to visualize the key content:

    # cat id_ed25519.pub

    Copy the key content. 

    5 - Now, access your GitHub account and access the path below:

    Setting > SSH and GPG Keys

    After accessing the directory above, click on the “New SSH key” option and paste the content that was copied previously.

    6 - In the next step, let’s start the git agent and link the name of the key for him:

    # eval $(ssh-agent -s)

    # ssh-add id_ed25519

    7 - Done!

    ---------------------------------------------------

    # Introdução ao Git na CLI local

    Olá comunidade DIO,

    Em primeiro lugar, obrigado por reservar seu tempo para ler este tutorial.

    Vamos aprender como realizar a configuração inicial do Git via CLI para que você possa fazer suas confirmações e enviar por push mais rapidamente.

    1 - No primeiro passo, é necessário criar uma conta na plataforma Git. Abaixo, você confere o respectivo link:

    https://github.com/

    2 - Após a criação da conta, vamos baixar o Git, através do link abaixo:

    https://git-scm.com/downloads

    Depois de baixar o Git, faça a instalação do aplicativo e escolha todas as opções padrão. O procedimento é automatizado.

    3 - Agora, após instalar o Git, você tem acesso à CLI ainda, através da opção "Bash CLI". Você pode esta opção em qualquer sistema de diretório, basta clicar com o botão direito do mouse.

    Ao acessar a CLI do terminal, o próximo passo é criar a chave com referência ao seu e-mail:

    # ssh-keygen -t ed25519 -C youremail@mail.com

    Importante: Lembre-se da maneira do diretório que essa chave foi criada.

    4 - Depois que a chave for criada, vamos olhar para o seu conteúdo (lembre-se do caminho onde a chave foi criada e acesse-a)

    Dica: Você tem 2 maneiras de acessar o caminho onde a chave foi criada. Primeiro, você pode ir para o respectivo caminho apenas usando o comando "cd" e colocando o respectivo caminho. Você também pode ir para o respectivo diretório apenas usando os arquivos do gerenciador do seu sistema operacional.

    Abaixo, está o comando para visualizar o conteúdo principal:

    # cat id_ed25519.pub

    Copie o conteúdo da chave.

    5 - Agora, acesse sua conta no GitHub e acesse o caminho abaixo:

    Settings > key SSH and GPG

    Após acessar o diretório acima, clique na opção "Nova chave SSH" e cole o conteúdo que foi copiado anteriormente.

    6 - Na próxima etapa, vamos iniciar o git agent e vincular o nome da chave para ele:

    # eval $(ssh-agente -s)

    # ssh-add id_ed25519

    7 - Feito!

    Compartilhe
    Comentários (0)