Open HuangJiaLian opened 4 years ago
step1: create a new repository in Github (Repositories--new)
step2: clone it to your computer
in the terminal: git clone + path(copy from Github such as:git@github.com:yychenleslie/usage_github.git)
step3: enter this repository
in the terminal: cd + document name(such as usage_github)
step4:
(1): if you need to create a new procedure, you can :
in the terminal: code .
(2): if you want to move something you want:
in the terminal: cp *** .
step1: git add+ document name (add the modified file) step2: git status(check the status) step3: git commit -m 'description' step4: git push
@yychenleslie
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
git config --global user.name "xxx"
git config --global user.email "xxxxxxx@xx.com"
ssh-keygen -t rsa -C "1050794513@qq.com"
xxxxxxxxx@xx.com是某个人的邮件名,回车会有以下输出:
Last login: Sat Jan 6 14:12:16 on ttys000
WMBdeMacBook-Pro:~ WENBO$ ssh-keygen -t rsa -C "xxxxxxxxx@xxx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/WENBO/.ssh/id_rsa):
/Users/WENBO/.ssh/id_rsa already exists.
Overwrite (y/n)? n
WMBdeMacBook-Pro:~ WENBO$
由于这里我原来已经创建过,这里我选n,没有创建过的,会要求确认路径和输入密码,我们这使用默认的一路回车就行。成功的话会在~/下生成.ssh文件夹,进去,打开id_rsa.pub,复制里面的key。
终端查看.ssh/id_rsa.pub
文件
open .ssh/id_rsa.pub
回车后,就会弹出一个终端,然后复制里面的key。
或者用cat命令查看
cat .ssh/id_rsa.pub
ssh -T git@github.com
终端输出结果
Last login: Sat Jan 6 14:42:55 on ttys000
WMBdeMacBook-Pro:~ WENBO$ ssh -T git@github.com
Hi wenmobo! You've successfully authenticated, but GitHub does not provide shell access.
WMBdeMacBook-Pro:~ WENBO$
说明已经链接成功。
如何在Window, MacOS下安装,使用git?