Git commands cheat sheet
2022-02-27 12:55:55
Handbook
1 | # Initialize a new git repository: |
Use Git like a pro.
Errors
Fix “ssh: connect to host github.com port 22: Connection timed out”
try to create or update ~/.ssh/config
as followed:
1 | Host github.com |
Then, run the command ssh -T git@github.com
to confirm if the issue is fixed.
Cannot fetch all remote branchs
try to open your git config by git config -e (--global)
, and then modify relevant configuration:
1 | [ ] |
after that, you can run git fetch --all
.