登陆控制台;
search service:
EC2 - 卷 - 操作修改卷 16G
C9: create new environment Dev(虚拟环境本地就麻烦 这里 安装git C9已经安装好了 ubuntu也创建好了) open IDE 我们就可以coding啦
terminal 上 cd ~/.ssh ls ssh-keygen -t rsa -C "你的邮箱"
ec2-user:~/environment $ cd ..
ec2-user:~ $ ls
environment node_modules package-lock.json
ec2-user:~ $ cd ~/.ssh
ec2-user:~/.ssh $ ls
authorized_keys
ec2-user:~/.ssh $ ssh-keygen -t rsa -C "xyang115@fordham.edu"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ec2-user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ec2-user/.ssh/id_rsa.
Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:K3F9vBCrctr4YGROqnrKfpIHMjVbrPqApeWW7DSApYQ xyang115@fordham.edu
The key's randomart image is:
+---[RSA 2048]----+
| |
|. |
|E... . |
|ooo o . + |
|+.o= = S + o |
|+Oo. * o o o . |
|=oX . * + . |
|oB.= . O |
|+BB o.o |
+----[SHA256]-----+
+----[SHA256]-----+
ec2-user:~/.ssh $ ls
authorized_keys id_rsa id_rsa.pub
ec2-user:~/.ssh $ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvr2Z8NS9AtbP7HRNnAPwVfJcpT6oeeSao0//jsF0Rf71VChzXxD6sNITBfku2KnXDT/vrax6LcPefTKIwxm3VG1a06euPKOjVs3Oa/BBdSfIR+q9d4+sl0//adM5hgdN67FrSLRPaRJxk70tiHfTRjNdQ13BnxLQi/7ALprlWe20wxSXvF+WWFFVhKF7RUTEm4/cfM6R+9NiXsremOQDeH7cjZwdbT
ec2-user:~/.ssh $ eval "$(ssh-agent -s)"启用SSH 功能
Agent pid 4193
ec2-user:~/.ssh $ ssh-add ~/.ssh/id_rsa 2 Key用这个功能
Identity added: /home/ec2-user/.ssh/id_rsa (/home/ec2-user/.ssh/id_rsa)
ec2-user:~/.ssh $ ssh -T git@github.com 3测试 test
The authenticity of host 'github.com (140.82.113.4)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,140.82.113.4' (RSA) to the list of known hosts.
Hi sissixiyang! You've successfully authenticated, but GitHub does not provide shell ac
ec2-user:~/.ssh $ git clone git@github.com:flagdream/CS703-1903-OGE.git
Cloning into 'CS703-1903-OGE'...
Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list o
remote: Enumerating objects: 136, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 136 (delta 32), reused 108 (delta 22), pack-reused 0
Receiving objects: 100% (136/136), 135.88 KiB | 3.67 MiB/s, done.
Resolving deltas: 100% (32/32), done.
ec2-user:~/.ssh $ ls
authorized_keys CS703-1903-OGE id_rsa id_rsa.pub known_hosts
ec2-user:~/.ssh $ sudo rm -rf CS703-1903-OGE/
ec2-user:~/.ssh $ cd ..
ec2-user:~ $ ls
environment node_modules package-lock.json
ec2-user:~ $ cd environment/
ec2-user:~/environment $ ls
README.md
ec2-user:~/environment $ git clone git@github.com:flagdream/CS703-1903-OGE.git
Cloning into 'CS703-1903-OGE'...
remote: Enumerating objects: 136, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 136 (delta 32), reused 108 (delta 22), pack-reused 0
Receiving objects: 100% (136/136), 135.88 KiB | 3.88 MiB/s, done.
Resolving deltas: 100% (32/32), done.
ec2-user:~/environment $ git branch
fatal: Not a git repository (or any of the parent directories): .git
ec2-user:~/environment $ cd CS703-1903-OGE/
ec2-user:~/environment/CS703-1903-OGE (master) $ git branch
* master
ec2-user:~/environment/CS703-1903-OGE (master) $ git pull homework origin/homework
#HW1
本地分支HW 对应远端的Github端(远端) origin是GitHub
fatal: 'homework' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.#本地没有就pull 没有就checkout 切换 - B创建新分枝
ec2-user:~/environment/CS703-1903-OGE (master) $ git checkout -b homework origin/homework
Branch homework set up to track remote branch homework from origin.
Switched to a new branch 'homework'
ec2-user:~/environment/CS703-1903-OGE (homework) $ git branch
* homework
master#两个分支了
ec2-user:~/environment/CS703-1903-OGE (homework) $ git pull origin homework#每次远端仓库用更新用它更新
ec2-user:~/environment $
ec2-user:~/environment $ ls
CS703-1903-OGE README.md
ec2-user:~/environment $ cd CS703-1903-OGE/
ec2-user:~/environment/CS703-1903-OGE (xiyang) $ git branch. ##创建xiyang:git checkout -b xiyang
fatal: A branch named 'xiyang' already exists. homework
master
* xiyang
ec2-user:~/environment/CS703-1903-OGE (xiyang) $ git pull origin homework
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
From github.com:flagdream/CS703-1903-OGE
* branch homework -> FETCH_HEAD
Already up-to-date.#我自己的分支来修改 在HW用pull origin 把老师 pull下来然后 merge 到xiyang:
ec2-user:~/environment/CS703-1903-OGE (xiyang) $ ls
executor README.md server
ec2-user:~/environment/CS703-1903-OGE (xiyang) $ git merge homework#把hw拉过来到xyang文件夹
Already up-to-date.
删 不要Client remove folder ...xiyang) $rm -rf client/
|