取消與遠(yuǎn)程分支的關(guān)聯(lián)
git remote remove origin
從零開始
git init????????初始化倉庫
git remote add origin http://yangxinmei@58.210.98.198:8888/fore-end/micro-service/tmp.git????????關(guān)聯(lián)遠(yuǎn)程分支
git add .????????添加所有文件到倉庫
git commit?-m "first commit"????????添加提交備注粘优,也可以不加-m "first commit"
git push -u origin master????????推送
查看關(guān)聯(lián)的遠(yuǎn)程倉庫地址
git remote -v
日常操作
git pull? ? 先拉
git status? ? 列出為提交的文件
git add .? ? 添加所有文件到倉庫
git commit -m "更新說明"? ? 提交
git push origin master? ? 推送到遠(yuǎn)程的master分支
ps:git commit -m “xxxxx”? ? ? ? 只能輸入一行信息,如果要輸入多行,使用git commit變回跳出文本編輯器
分支相關(guān)
git branch -a? ? ? ? 查看所有分支
$ git checkout -b develop origin/develop? ? 在本地創(chuàng)建一個分支,并進(jìn)入分支,與遠(yuǎn)程已有分支相對應(yīng)
git branch -vv? 查看本地關(guān)聯(lián)的遠(yuǎn)程分支
修改分支名稱(本地及遠(yuǎn)程):http://www.reibang.com/p/cc740394faf5
修改分支筆記
git branch -m oldName newName? ? 修改本地分支的名字
git push origin newName? ? 以新名稱直接推送到遠(yuǎn)程,會自動創(chuàng)建分支。這里的newName?不加origin/倘零,直接是新名字
git branch --set-upstream-to origin/newName? (這一步的手動實現(xiàn)存疑,好像通過上上面的步驟是可以直接實現(xiàn)這個關(guān)聯(lián)的)
題外話宝当,刪除遠(yuǎn)程分支git push --delete origin oldName