DES:Git

De Wiki Unioeste NTI
(Diferença entre revisões)
Ir para: navegação, pesquisa
(Remover um submódulo)
 
(12 edições intermediárias de 2 usuários não apresentadas)
Linha 1: Linha 1:
Configurar usuário para commit/push (Utilizar nome completo e email/usuário da Unioeste)
+
==Baixar Git==
 +
Para instalar o Git e ter as ferramentas por linha de comando: https://git-scm.com/download/win
 +
 
 +
==Configurar usuário para commit/push==
 +
Utilizar nome completo e email/usuário da Unioeste
  
 
   git config --global user.name "Tiago Alexandre Schulz Sippert"
 
   git config --global user.name "Tiago Alexandre Schulz Sippert"
Linha 5: Linha 9:
 
   git config --global credential.helper store
 
   git config --global credential.helper store
  
* Quando trocar a senha e não logar mais, basta executar as três linhas acima novamente e vai pedir as credenciais novamente.
+
* Quando trocar a senha e não logar mais, deve-se ir no painel de controle do Windows, acessar o gerenciador de credenciais e remover a credencial referente ao Git. Depois deve-se fazer o processo acima novamente.
 +
[[Arquivo:credencial_git.png]]
  
Baixar o projeto
+
==Baixar o projeto==
  
 
   git clone http://netsr-vers01.unioeste.br:82/java-project/academus.git --recursive
 
   git clone http://netsr-vers01.unioeste.br:82/java-project/academus.git --recursive
  
 +
== Inicializar um projeto novo (MODO FACIL) ==
  
Inicializar um projeto
+
Estes passos lhe guiarão na criação de um projeto novo, baseando-se no '''projetobase''', que é um projeto maven simples de exemplo que já contém o sharedev-vraptor3 e o sharedev-ext4.
  
   git clone http://netsr-vers01.unioeste.br:82/java-project/pwm-unioeste.git temp
+
   Vai em NEW PROJECT no GitLab
 +
  Preencha as informações assim:
 +
    path -> nome do projeto (geralmente é o sstCodigo)
 +
    namespace -> java-project
 +
    Import project from -> Any repo by URL
 +
    Git repository URL -> http://usuariounioeste:senhaunioeste@netsr-vers01.unioeste.br:82/java-project/projetobase.git
 +
    Visibility Level -> Private
 +
  Clique em CREATE PROJECT
 +
 
 +
== Inicializar um projeto novo (modo antigo) ==
 +
 
 +
  git clone http://netsr-vers01.unioeste.br:82/java-project/projetobase.git temp
 
   cd temp
 
   cd temp
 
   git archive -o ..\temp.zip HEAD | unzip ..\temp.zip -d ..\new
 
   git archive -o ..\temp.zip HEAD | unzip ..\temp.zip -d ..\new
Linha 23: Linha 40:
  
 
   git init
 
   git init
   git remote add origin http://netsr-vers01.unioeste.br:82/java-project/base-project.git
+
   git remote add origin http://netsr-vers01.unioeste.br:82/java-project/nome-do-novo-projeto.git
 
   git push -u origin master  
 
   git push -u origin master  
+
 
 
+
== Adicionar um submódulo ==
 
   git submodule add URL_DA_BIBLIOTECA.git DIRETORIO_DESTINO
 
   git submodule add URL_DA_BIBLIOTECA.git DIRETORIO_DESTINO
 +
Exemplo: (estando no root do projeto. tenha cuidado com as barras de diretório)
 +
  git submodule add http://netsr-vers01.unioeste.br:82/java-shared/sharedev-ext6.git src/main/webapp/sharedev
  
 +
== Remover um submódulo ==
 +
  # Remove the submodule entry from .git/config
 +
  git submodule deinit -f path\to\submodule
 +
  Exemplo: git submodule deinit -f src/main/webapp/sharedev
  
Explicar:
+
  # Remove the submodule directory from the superproject's .git/modules directory
 +
  rm .git\modules\path\to\submodule -r -fo
 +
  Exemplo: rm .git\modules\src\main\webapp\sharedev -r -fo
 +
 
 +
  # Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
 +
  git rm -f path\to\submodule
 +
  Exemplo: git rm -f src/main/webapp/sharedev
 +
 
 +
== Explicar Ainda ==
 
   -o que tem em cada arquivo .git (gitmodule,gitignore,etc)
 
   -o que tem em cada arquivo .git (gitmodule,gitignore,etc)
 
   -como funciona os submodulos
 
   -como funciona os submodulos
  
 
+
==Anotações Gerais==
  
 
Utilização de Tag's para as issues criadas no GitLab (por enquanto nada disso é utilizado)
 
Utilização de Tag's para as issues criadas no GitLab (por enquanto nada disso é utilizado)
Linha 42: Linha 73:
 
https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
 
https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
  
pri low,normal,high,critical
+
  pri low,normal,high,critical
type bug,feature,enhancement,discussion,
+
  type bug,feature,enhancement,discussion,
idea,support,task
+
  idea,support,task
status in-progress,resolved,
+
  status in-progress,resolved,
others wontfix,invalid,duplicate, on hold
+
  others wontfix,invalid,duplicate, on hold
question,documentation,todo,
+
  question,documentation,todo,
design,watchlist,
+
  design,watchlist,
optimization
+
  optimization
 +
==Configurar o proxy para baixar repositórios externos==
 +
 
 +
  git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

Edição atual tal como 13h52min de 13 de junho de 2023

Tabela de conteúdo

[editar] Baixar Git

Para instalar o Git e ter as ferramentas por linha de comando: https://git-scm.com/download/win

[editar] Configurar usuário para commit/push

Utilizar nome completo e email/usuário da Unioeste

 git config --global user.name "Tiago Alexandre Schulz Sippert"
 git config --global user.email "tiago.sippert@unioeste.br"
 git config --global credential.helper store
  • Quando trocar a senha e não logar mais, deve-se ir no painel de controle do Windows, acessar o gerenciador de credenciais e remover a credencial referente ao Git. Depois deve-se fazer o processo acima novamente.

Credencial git.png

[editar] Baixar o projeto

 git clone http://netsr-vers01.unioeste.br:82/java-project/academus.git --recursive

[editar] Inicializar um projeto novo (MODO FACIL)

Estes passos lhe guiarão na criação de um projeto novo, baseando-se no projetobase, que é um projeto maven simples de exemplo que já contém o sharedev-vraptor3 e o sharedev-ext4.

 Vai em NEW PROJECT no GitLab
 Preencha as informações assim:
   path -> nome do projeto (geralmente é o sstCodigo)
   namespace -> java-project
   Import project from -> Any repo by URL
   Git repository URL -> http://usuariounioeste:senhaunioeste@netsr-vers01.unioeste.br:82/java-project/projetobase.git
   Visibility Level -> Private
 Clique em CREATE PROJECT

[editar] Inicializar um projeto novo (modo antigo)

 git clone http://netsr-vers01.unioeste.br:82/java-project/projetobase.git temp
 cd temp
 git archive -o ..\temp.zip HEAD | unzip ..\temp.zip -d ..\new
 cd ..
 rm temp.zip
 rm -R -f temp
 cd new
 git init
 git remote add origin http://netsr-vers01.unioeste.br:82/java-project/nome-do-novo-projeto.git
 git push -u origin master 

[editar] Adicionar um submódulo

 git submodule add URL_DA_BIBLIOTECA.git DIRETORIO_DESTINO

Exemplo: (estando no root do projeto. tenha cuidado com as barras de diretório)

 git submodule add http://netsr-vers01.unioeste.br:82/java-shared/sharedev-ext6.git src/main/webapp/sharedev

[editar] Remover um submódulo

 # Remove the submodule entry from .git/config
 git submodule deinit -f path\to\submodule
 Exemplo: git submodule deinit -f src/main/webapp/sharedev
 # Remove the submodule directory from the superproject's .git/modules directory
 rm .git\modules\path\to\submodule -r -fo
 Exemplo: rm .git\modules\src\main\webapp\sharedev -r -fo
 # Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
 git rm -f path\to\submodule
 Exemplo: git rm -f src/main/webapp/sharedev

[editar] Explicar Ainda

 -o que tem em cada arquivo .git (gitmodule,gitignore,etc)
 -como funciona os submodulos

[editar] Anotações Gerais

Utilização de Tag's para as issues criadas no GitLab (por enquanto nada disso é utilizado)

TAGS: https://www.quora.com/What-is-the-best-way-to-name-GitHub-issue-labels https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/

 pri	low,normal,high,critical
 type	bug,feature,enhancement,discussion,
 		idea,support,task
 status	in-progress,resolved,
 others	wontfix,invalid,duplicate, on hold
 		question,documentation,todo,
 		design,watchlist,
 		optimization

[editar] Configurar o proxy para baixar repositórios externos

 git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
Ferramentas pessoais
Espaços nominais
Variantes
Ações
Navegação
Ferramentas