DES:Git
De Wiki Unioeste NTI
(Diferença entre revisões)
(→Remover um submódulo) |
|||
(7 edições intermediárias de 2 usuários não apresentadas) | |||
Linha 9: | Linha 9: | ||
git config --global credential.helper store | git config --global credential.helper store | ||
− | * Quando trocar a senha e não logar mais, | + | * 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== | ||
Linha 49: | Linha 45: | ||
== Adicionar um submódulo == | == 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 | + | 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 | ||
+ | |||
+ | # 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 == | == Explicar Ainda == | ||
Linha 72: | Linha 81: | ||
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.
[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