久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      git命令解析

      最近在學(xué)習(xí)git,這邊整理一下學(xué)習(xí)筆記,有不對(duì)的地方歡迎大家指正。

      各處${…}表示實(shí)際使用中需要填寫(xiě)的參數(shù)

      一、tag相關(guān)

      tag即給當(dāng)前的代碼版本打上標(biāo)簽進(jìn)行區(qū)分,我理解為版本管理。

      git獲取指定tag的版本

      1.clonemaster上的代碼

      2.git checkout test—-表示切換到test分支

      3.git checkout ${tagName}

      獲取當(dāng)前的tag

      git tag -l

      給當(dāng)前代碼版本打tag

      git tag -a ${tagName} -m 'Release Version' (-m參數(shù)后面跟的是對(duì)這個(gè)tag的說(shuō)明,這個(gè)根據(jù)實(shí)際需要填寫(xiě))

      推送tag

      git push origin ${tagname} (推送指定名字的標(biāo)簽)

      git push origin –tags (推送所有新增的標(biāo)簽)

      查看tag信息

      git show ${tagName}

      刪除本地標(biāo)簽

      git tag -d ${tagName}

      刪除遠(yuǎn)程標(biāo)簽(tag已經(jīng)推送到遠(yuǎn)程倉(cāng)庫(kù))

      1.先刪除本地標(biāo)簽

      2.git push origin :refs/tags/v0.9 注意空格

      對(duì)已經(jīng)提交的歷史版本打標(biāo)簽

      git tag ${tagName} ${commitId}

      二、分支相關(guān)

      git切換到已有分支:

      1.先clonemaster上的代碼

      2.然后git checkout test—-表示切換到test分支

      git新建并且切換到分支

      1.先clonemaster上的代碼

      2.然后git checkout -b test—-表示新建test分支并且進(jìn)行切換

      推送分支到遠(yuǎn)程倉(cāng)庫(kù)

      git push origin 分支名(最好不要省略)

      將當(dāng)前分支推送到origin主機(jī)的對(duì)應(yīng)分支。

      查看遠(yuǎn)程分支

      git branch -a

      Git合并分支

      git merge ${branchName}

      git刪除分支

      git branch -d ${branchName}

      查看分支合并詳情

      git log –graph –pretty=oneline –abbrev-commit

      分支合并-禁用fast forward模式

      git merge –no-ff -m "merge with no-ff” ${branchName}

      丟棄一個(gè)沒(méi)有合并過(guò)的分支

      git branch -D${branchName}

      指定本地分支與遠(yuǎn)程分支的連接,與遠(yuǎn)程分支建立關(guān)聯(lián)

      git branch –set-upstream-to=origin/dev dev

      存在遠(yuǎn)程分支,在本地創(chuàng)建分支,與遠(yuǎn)程分支相對(duì)應(yīng)

      git checkout -b ${branchName} origin/${branchName}

      三、其他

      git一般使用流程

      1.git clone

      #有需要的話(huà)切換分支或者獲取tag

      2.git checkout ${branchName} origin/${branchName}

      or

      git checkout ${tagName}

      #進(jìn)行相關(guān)文件內(nèi)容的變更

      3.mkdir/git rm -rf /vim…

      4.git add -A(將本地的變更提交到暫存區(qū))

      5.git commit -m “變更說(shuō)明”

      6.git push origin 分支名

      #如果有需要?jiǎng)t推送tag

      7.git push origin –tags

      查看當(dāng)前origin

      git remote -v

      顯示了可以抓取和推送的origin的地址。如果沒(méi)有推送權(quán)限,就看不到push的地址。

      查看當(dāng)前工作區(qū)與版本庫(kù)最新版本的區(qū)別

      git diff HEAD –filename

      讓文件回到最近一次commit或add的狀態(tài)

      git checkout –${file}

      撤銷(xiāo)暫存區(qū)的修改

      git reset HEAD ${fileName}

      將本地庫(kù)與遠(yuǎn)程庫(kù)進(jìn)行關(guān)聯(lián)

      git remote add origin git@github.com:*********.git

      切換origin

      git push –set-upstream origin dev

      存儲(chǔ)當(dāng)前工作現(xiàn)場(chǎng)

      git stash

      查看存儲(chǔ)的列表

      git stash list

      恢復(fù)存儲(chǔ)的內(nèi)容并且刪除臨時(shí)存儲(chǔ)

      git stash pop

      刪除遠(yuǎn)程庫(kù)

      git remote rm origin

      本地關(guān)聯(lián)多個(gè)遠(yuǎn)程庫(kù)

      git remote add 別名1 git@github.com:*****.git

      git remote add 別名2 git@gitee.com:*****.git

      別名可以自己取

      建立一個(gè)本地倉(cāng)庫(kù)

      1.新建文件夾test

      2.cdtest

      3.git init

      git查看詳細(xì)日志

      git log –pretty=oneline

      git克隆指定分支的代碼

      git clone -b

      git版本回退:

      在Git中,用HEAD表示當(dāng)前版本,上一個(gè)版本就是HEAD^,上上一個(gè)版本就是HEAD^^,當(dāng)然往上100個(gè)版本寫(xiě)100個(gè)^比較容易數(shù)不過(guò)來(lái),所以寫(xiě)成HEAD~100。

      例如:

      git reset –hard HEAD^—表示回退到上一個(gè)版本

      從老版本回到新版本

      git reset –hard 1094a (新版本的commitid)

      git查看歷史的commitid

      git reflog

      查看狀態(tài):

      gitstatus

      git工作原理圖解(圖片轉(zhuǎn)自廖雪峰老師git教程)

      stage=暫存區(qū)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)