https://git-school.github.io/visualizing-git/
ssh-keygen -t rsa -b 4096 -C "bscpaz@mail.com"git remote -vgit clone -o <remote name> git@github.com:bscpaz/<repository>git clone git@github.com:<user>/<repositorio>.gitgit remote add <remote name> https://git....git remote set-url origin git@github.com:bscpaz/<repository>git remote remove <remote name>git remote rename <old> <new>https://www.freecodecamp.org/news/how-to-fix-git-always-asking-for-user-credentials/
(Se pasta recém-criada)
git initgit config core.sshCommand 'ssh -i "/home/bscpaz/.ssh/id_rsa"'git config --global user.name "Bruno Paz"git config --global user.email "soujava@gmail.com"git config --local user.name "Bruno Paz"git config --local user.email "soujava@gmail.com"git config --global credential.helper storesudo apt-get install gnome-keyringgit config --global credential.helper gnome-keyringgit config --global credential.useHttpPath trueNote: if the authentication fails, close the terminal and try again.
git config --global user.namegit config --global user.emailgit config --local user.namegit config --local user.emailgit branchgit branch -D <branch name>git checkout -b <branch name> --track <remote>/<branch>git checkout <branch name>git branch -m <new name>git log -p .git log -p <file-name>git diff <file-name>git commit --amend --author="Bruno Paz<soujava@gmail.com>"Issue:
Clonning a git repository using WSL2 occurs timeout on port 22 or 443
bscpaz@2am:/$ git clone git@github.com:bscpaz/<some-repo>
Cloning into '<some-repo>'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Solution:
- First, check if your WSL2 can run a "sudo apt-get update". If not, it's a general problem.
- Turn off your VPN and try again.