git push
git pull
臨時倉庫==暫存區
##############創建提交################
git init ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #創建git地址
git config --global user.name "***YQ1007"
git config --global user.email "***@gmail.com"
git remote add origin https:/*****.git ? ? ? ?#添加倉庫地址
git remote -v ? ? ? ? ? ? ? ? ? ? ? ? ? ? #顯示
git add . ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#添加到臨時倉庫
git push -u origin main ? ? ? ? ? ?#上傳到github
#######################################
##############暫存區創建提交################
git commit 命令的核心作用是將暫存區 (staging area) 中的更改,永久記錄到你的本地 Git 倉庫的歷史記錄中,創建一個提交 (commit)。
git commit -m "Initial commit" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #首次提交,并更改首次提交的信息"Initial commit" ??
#######################################
##############相關操作################
rm -f .git/index.lock ? ? ? ? ? ? ? ? ?#刪除git鎖定
#######################################
##############使用SSH密鑰上傳的相關操作################
?ssh-keygen -t rsa -b 4096 -C "***@qq.com" ? ? ? ? ? ? ? ? ?#生成一個新的 SSH 密鑰對
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa ? ? ? ? ? ? ? ?#啟動 SSH 代理并將密鑰添加到代理中
cat ~/.ssh/id_rsa.pub ? ? ? ? ? ? ? ?#查看你生成的公鑰內容,輸出公鑰
ssh -T git@github.com ? ? ? ? ? ? #測試SSH 密鑰是否可以與 GitHub 正常工作
git remote set-url origin? ******uating.git ? ? ? ? #切換為 SSH 連接
git push --set-upstream origin main ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#推送你的 main 分支,并設置 upstream
#######################################
##############提交后更改的相關操作################
git status ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#查看更改狀態
git add <file_name_1> <file_name_1> .. ? ? ? ? ? ?#將更改添加到暫存區
或者用git add .? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#將all更改添加到暫存區
git commit -m "Your commit message" ? ? ? ? ? ? #提交更改
git push ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#提交更改
#######################################
?