Projetos e estudos sobre Git.
- Controle de Versão
- Armazenamento em Nuvem
- Colaborativo
- Blobs
- Trees
- Commits
- Merge
- Squash and Merge
- Rebase and Merge
Linux
apt install git
add-apt-repository ppa:git-core/ppa
apt update
apt install git
Criando chave SSH
ssh-keygen -t ed25519 -C "[email protected]"
Local de Armazenamento
/home/%userhome%/.ssh
Corrigir permissões do arquivo
chmod 600 /home/%userhome%/.ssh/id_ed25519
Copiar a chave Pública
cat "nome da chave"
Inicializar
eval "$(ssh-agent -s)"
Enviar a chave
ssh-add "nome da chave"
Teste copiando um repositório privado
git clone [email protected]:luiscruzcwb/luiscruz.com.br.git
# Altere para o seu endereço
- sudo apt install xdg-utils
- touch ~/.ssh/config
- nano config
git help
git init
git config --list
git config --global user.email [email protected]
git config --global user.name Nome Sobrenome
Caso seja preciso atualizar os dados:git config --global --unset "mudar o que precisa"
git add
git add *
git add/rm
git commit
git commit -m "Descrição do Commit"
git push
git push -v
git push -4
git push -u origin main
git push --force / git push -f
Adicionar arquivos:
git remote add origin https://github.com/%UserName%/%RepositoryName%.git
git remote -v
git branch -M main
git status
git status -v
git branch "nome"
git branch --all
git checkout "nome da branch"
git push --set-upstream origin "nome da branch"
git checkout
git checkout -b
git checkout -f
git checkout --
-
git branch -v
-
git merge
-
git branch -d
Excluir Branch -
git branch -v
-
git fetch
-
git diff
-
git stash
- fatal: Authentication Failed
git remote -v
git remote set-url origin [email protected]:<user>/<repo>.git
git remote set-url origin [email protected]:<user>/<repo>.git
-
Arquivo
.gitkeep
Mostra pastas vazias -
Arquivo
.gitignore
Oculta arquivos ou extensões definidas nesse arquivo -
git restore
Usado caso um arquivo tenha sido alterado, e seja preciso restaurar -
git commit --amend -m
Mudar o comentario ao executar um commit -
git reset "nome do arquivo"
-
git reset --soft
-
git reset --mixed
-
git reset --hard
-
git reflog