亚洲精品中文免费|亚洲日韩中文字幕制服|久久精品亚洲免费|一本之道久久免费

<optgroup id="cczp1"><ruby id="cczp1"><cite id="cczp1"></cite></ruby></optgroup>
  • <acronym id="cczp1"></acronym>
    <acronym id="cczp1"><option id="cczp1"><ol id="cczp1"></ol></option></acronym>
    <delect id="cczp1"></delect>
    <center id="cczp1"></center>
    <delect id="cczp1"></delect><em id="cczp1"><button id="cczp1"><blockquote id="cczp1"></blockquote></button></em>
    1. <optgroup id="cczp1"><td id="cczp1"><dfn id="cczp1"></dfn></td></optgroup>

      20個(gè)頂級(jí) Git 命令示例

      20個(gè)頂級(jí) Git 命令示例

      現(xiàn)在您(可能)已經(jīng)知道了 Git 是什么以及它是如何工作的,接下來看看如何使用前20個(gè) Git 命令示例

      在前面的博客中,您了解了什么是 git。在這個(gè)博客中,我將介紹在使用 Git 時(shí)經(jīng)常使用的前20個(gè) Git 命令。

      以下是 Git 命令:

      • git config
      • git init
      • git clone
      • git add
      • git commit
      • git diff
      • git reset
      • git status
      • git rm
      • git log
      • git show
      • git tag
      • git branch
      • git checkout
      • git merge
      • git remote
      • git push
      • git pull
      • git stash

      我們開始吧!

      Git Commands

      git config

      用法: git config-global user.name“[ name ]”

      用法: git config-global user.email“[ email address ]”

      此命令分別設(shè)置提交時(shí)使用的作者姓名和電子郵件地址。

      git init

      用法: git init [存儲(chǔ)庫名稱]

      此命令用于啟動(dòng)新的存儲(chǔ)庫。

      git clone

      用法: git clone [ url ]

      此命令用于從現(xiàn)有 URL 獲取存儲(chǔ)庫。

      git add

      用法: git add [ file ]

      此命令將一個(gè)文件添加到暫存區(qū)域。

      用法: git add *

      此命令將一個(gè)或多個(gè)添加到暫存區(qū)域。

      git commit

      用法: git commit-m“[鍵入提交消息]”

      此命令在版本歷史記錄中永久記錄或快照文件。

      用法: git commit-a

      此命令提交您使用 git add 命令添加的所有文件,并提交此后更改的所有文件。

      git diff

      用法: git diff

      此命令顯示尚未暫存的文件差異。

      用法: git diff-stage

      此命令顯示暫存區(qū)域中的文件與現(xiàn)有的最新版本之間的差異。

      用法: git diff [第一個(gè)分支][第二個(gè)分支]

      這個(gè)命令顯示了上面提到的兩個(gè)分支之間的區(qū)別。

      git reset

      用法: git reset[ file ]

      此命令取消文件的準(zhǔn)備工作,但保留文件內(nèi)容。

      用法: git reset[提交]

      此命令在指定的提交之后撤消所有提交,并在本地保留更改。

      Usage: git reset –hard [commit]

      用法: 這個(gè)命令丟棄所有的歷史記錄并返回到指定的提交。

      git status

      用法: git status

      此命令列出必須提交的所有文件。

      git rm

      用法: git rm [ file ]

      這個(gè)命令會(huì)從你的工作目錄中刪除這個(gè)文件,然后進(jìn)行刪除。

      git log

      用法: git log

      此命令用于列出當(dāng)前分支的版本歷史記錄。

      用法: git log-follow [ file ]

      此命令列出文件的版本歷史記錄,還包括文件的重命名。

      git show

      用法: git show [ commit ]

      此命令顯示指定提交的元數(shù)據(jù)和內(nèi)容更改。

      git tag

      用法: git 標(biāo)記[ committee ID ]

      此命令用于為指定的提交提供標(biāo)記。

      git branch

      用法: git Branch

      此命令列出當(dāng)前存儲(chǔ)庫中的所有本地分支。

      用法: git Branch [ Branch name ]

      此命令將創(chuàng)建一個(gè)新分支。

      用法: git Branch-d [ Branch name ]

      此命令刪除特性分支。

      git checkout

      用法: git checkout [分支名稱]

      此命令用于從一個(gè)分支切換到另一個(gè)分支。

      用法: git checkout-b [分支名稱]

      這個(gè)命令創(chuàng)建一個(gè)新的分支,并切換到它。

      Git 合并

      用法: git merge [分支名]

      此命令將指定分支的歷史記錄合并到當(dāng)前分支中。

      git remote

      用法: git remote add[變量名][遠(yuǎn)程服務(wù)器鏈接]

      此命令用于將本地存儲(chǔ)庫連接到遠(yuǎn)程服務(wù)器。

      git push

      用法: git push [ variable name ] master

      此命令將主分支的提交更改發(fā)送到遠(yuǎn)程存儲(chǔ)庫。

      用法: git push [ variable name ][ Branch ]

      此命令將分支提交發(fā)送到遠(yuǎn)程存儲(chǔ)庫。

      用法: git push-all [ variable name ]

      此命令將所有分支推送到遠(yuǎn)程存儲(chǔ)庫。

      用法: git push [ variable name ] : [ Branch name ]

      此命令將刪除遠(yuǎn)程存儲(chǔ)庫上的一個(gè)分支。

      git pull

      用法: git pull [ Repository Link ]

      此命令將遠(yuǎn)程服務(wù)器上的更改獲取并合并到您的工作目錄。

      git stash

      用法: git stash save

      此命令臨時(shí)存儲(chǔ)所有已修改的跟蹤文件。

      用法: git stash pop

      此命令還原最近隱藏的文件。

      用法: git stash list

      此命令列出所有隱藏的變更集。

      用法: git stash drop

      此命令放棄最近隱藏的變更集。

      想了解更多關(guān)于 git 命令的信息嗎?這里有一個(gè) Git 教程來幫助你開始。或者,您可以采用自頂向下的方法,從這個(gè) DevOps 教程開始。

      鄭重聲明:本文內(nèi)容及圖片均整理自互聯(lián)網(wǎng),不代表本站立場,版權(quán)歸原作者所有,如有侵權(quán)請(qǐng)聯(lián)系管理員(admin#wlmqw.com)刪除。
      用戶投稿
      上一篇 2022年6月20日 09:16
      下一篇 2022年6月20日 09:18

      相關(guān)推薦

      聯(lián)系我們

      聯(lián)系郵箱:admin#wlmqw.com
      工作時(shí)間:周一至周五,10:30-18:30,節(jié)假日休息