將本地倉庫關聯到遠程倉庫
方式一:遠程倉庫沒有文件
step_one: git init(初始化git倉庫);
step_two: git remote add 地址(設置remote地址);
step_three: git add . (將所有變更提交到本地倉庫);
step_four: git commit -m '' (提交注釋);
step_five: git push(本地倉庫推送到遠程倉庫)
方式二:遠程倉庫有文件
step_one: git init(初始化git倉庫);
step_two: git remote add origin 地址(設置遠程remote地址);
step_three: git pull origin master(拉取遠程倉庫master的文件)
step_four: git branch --set-upstream-to=origin/master master(將本地master設置為遠程master分支)
step_five: git add . (將所有變更提交到本地倉庫);
step_six: git commit -m '' (提交注釋);
step_seven: git push(本地倉庫推送到遠程倉庫)
方式三:
step_one: 建一個文件夾,進入文件夾打開命令行工具;
step_two: git clone 地址(克隆遠程倉庫);
step_three: 將項目文件復制到新建文件夾中;
step_four: git add . (將所有變更提交到本地倉庫);
step_five: git commit -m '' (提交注釋);
step_six: git push(本地倉庫推送到遠程倉庫)
設置用戶和郵箱
一:全局
git config --global user.name "you name"
git config --global user.email "you email"
二:局部(單個項目)
git config user.name "you name"
git config user.email "you email"