Projeto

Geral

Perfil

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

Revisão 2 (André Vidal, 11/10/2021 15:34 h) → Revisão 3/6 (André Vidal, 11/10/2021 15:36 h)

h1. Uso do GIT no terminal da rasp 

 Depois de ja se conectar com a rasp, dê cd para a pasta HRR-Intel. 
 Após isso, use o comando *git init*. git init. 
 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. 
 Voce pode usar *git status* git status para saber as alterações (Voce deve estar na main) 
 Use *git pull* 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. 
 Faça as alterações. 
 Use *git status* git status para verificar o que voce alterou. 
 Use *git git add ARQUIVO_A_SER_MODIFICADO.txt* ARQUIVO_A_SER_MODIFICADO.txt para o arquivo a ser modificado ser adicionado a lista de alterações a serem feitas no proximo commit. 
 Se quiser adicionar todos os arquivos modificados de uma vez voce pode usar *git add .* . 
 Se voce quiser ignorar um arquivo nas modificacoes, dentro da pasta HRR-Intel use *nano .gitignore* nano .gitignore para adicionar o arquivo na lista de exceções. 
 Use *git commit* git commit -m 'comentario que voce quer adicionar no commit que descreve as alteracoes que voce fez'. 
 Use *git push* git push https://[email protected]/roboime/HRR-Intel.git 

 h3. Creating a personal access token 

 You should create a personal access token to use in place of a password with the command line or with the API. 
 In the upper-right corner of any page, click your profile photo, then click Settings. 
 In the left sidebar, click Developer settings. 
 In the left sidebar, click Personal access tokens. 
 Click Generate new token. 
 Give your token a descriptive name. 
 To give your token an expiration, select the Expiration drop-down menu, then click a default or use the calendar picker. 
 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*. 
 !tutorialgit.png! 
 Click Generate token. 
 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. 
 Copie o código que aparecer e salve em algum lugar.