先打開Cloud9的環境,並在Terminal中輸入以下的指令安裝git
sudo yum -y update # Install the latest system updates.
sudo yum -y install git # Install Git.
git --version # Confirm Git was installed.
若安裝成功的話,在檢查git version時會出現版號
先使用以下script設定git
git config --global user.name "USER_NAME"
git config --global user.email EMAIL_ADDRESS
先產生一個readme.md
echo "# aws-cloud9-practice" >> README.md
初始化init project
git init
將readme.md加入commit清單
git add README.md
填寫commit message
git commit -m "first commit"
選擇要推到哪個branch
git branch -M main
要推到哪個repository
git remote add origin https://github.com/sabaao/aws-cloud9-practice.git
push至遠端伺服器
git push -u origin main
上github驗証是否上傳成功
30天終於結束了!!!!
https://docs.aws.amazon.com/zh_tw/cloud9/latest/user-guide/sample-github.html