git

get ssh key:

1
2
3
4
5
6
7
ssh-keygen -t rsa -C "[xxx@xxx.com](mailto:xxx@xxx.com)"

<enter until ...>

cd ~/.ssh

cat id_rsa.pub

git initialize:

1
2
3
git config --global user.name "username"

git config --global user.email "<email>"

for proxy:

1
2
3
4
5
6
7
8
9

git config --global http.proxy http://127.0.0.1:7897

git config --global https.proxy http://127.0.0.1:7897

# and we can test with:
git config --global --get http.proxy

git config --global --get https.proxy

firewall or ISP ban git port

sometimes, schools or companies may block data traffic, including ssh’s default port 22.

when git is banned, we can use the alternative port provided by github, create a file(if not exist) ~/.ssh/config, and add:

1
2
3
4
5
Host github.com
Hostname ssh.github.com
Port 443
User git

and test with ssh -T git@github.com

command lines homepage

click here to come back to command line homepage.