Projeto

Geral

Perfil

Uso do GIT no terminal da rasp » Histórico » Versão 3

André Vidal, 11/10/2021 15:36 h

1 1 André Vidal
h1. Uso do GIT no terminal da rasp
2 2 André Vidal
3
Depois de ja se conectar com a rasp, dê cd para a pasta HRR-Intel.
4 3 André Vidal
Após isso, use o comando *git init*.
5 2 André Vidal
Voce precisa criar um token no git para fazer as coisas pelo terminal. Para isso, visite o tuto "https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token", cujas partes importantes listei abaixo.
6 3 André Vidal
Voce pode usar *git status* para saber as alterações (Voce deve estar na main)
7
Use *git pull* https://"ghp_tnzVGavP0ay0gSkX7InfG0DHA7hdss2MdEmN"@github.com/roboime/HRR-Intel.git , onde a parte entre aspas "" é a chave que voce copiou. Não consegui tirar a marcação azul do redmine, mas ela faz parte do comando.
8 2 André Vidal
Faça as alterações.
9 3 André Vidal
Use *git status* para verificar o que voce alterou.
10
Use *git add ARQUIVO_A_SER_MODIFICADO.txt* para o arquivo a ser modificado ser adicionado a lista de alterações a serem feitas no proximo commit.
11 2 André Vidal
Se quiser adicionar todos os arquivos modificados de uma vez voce pode usar *git add .* .
12 3 André Vidal
Se voce quiser ignorar um arquivo nas modificacoes, dentro da pasta HRR-Intel use *nano .gitignore* para adicionar o arquivo na lista de exceções.
13
Use *git commit* -m 'comentario que voce quer adicionar no commit que descreve as alteracoes que voce fez'.
14
Use *git push* https://[email protected]/roboime/HRR-Intel.git
15 2 André Vidal
16
h3. Creating a personal access token
17
18
You should create a personal access token to use in place of a password with the command line or with the API.
19
In the upper-right corner of any page, click your profile photo, then click Settings.
20
In the left sidebar, click Developer settings.
21
In the left sidebar, click Personal access tokens.
22
Click Generate new token.
23
Give your token a descriptive name.
24
To give your token an expiration, select the Expiration drop-down menu, then click a default or use the calendar picker.
25
Select the scopes, or permissions, you'd like to grant this token. To use your token to access repositories from the command line, *select repo*.
26
!tutorialgit.png!
27
Click Generate token.
28
Warning: Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.
29
Copie o código que aparecer e salve em algum lugar.