1. 程式人生 > >創建本地Git並提交到碼雲

創建本地Git並提交到碼雲

oracl 安全 配置ssh 分支 first onf ali remote cat

使用Git Bash創建本地Git全局用戶名,提交遠程代碼時將以此用戶名顯示
git config --global --replace-all user.email "[email protected]"
git config --global --replace-all user.name "itoracle"

在碼雲上創建一個git:https://gitee.com/itdb/all.git

進入D盤
cd /d
下載遠程git到本地
git clone https://gitee.com/itdb/all.git
#在本地添加一個遠程git配置all,以後all就代表了遠程的 https://gitee.com/itdb/all.git

git remote add all https://gitee.com/itdb/all.git

配置SSH
cd /c/Users/thinkpad
ssh-keygen -t rsa -C "[email protected]"
cd .ssh
cat id_rsa.pub
$ cat id_rsa.pub
ssh-rsa AAAAB3……n.com
將本地公鑰復制到以下地方
設置-->安全設置-->SSH公鑰

復制文件到git目錄並上傳的遠程git,首次提交需要加-u
cp -r /e/all/fxzonghe_cmd /d/all

cd /d/all
git add .
git status

git commit -m "ppcore first commit"
將本地git推送到遠程all的master分支
git push -u all master


第二次提交,沒有使用-u參數
cd /d/all
git add .
git status
git commit -m "all second commit"
git push all master

創建本地Git並提交到碼雲