内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

Git基礎(chǔ)入門(mén)(七)Git撤銷操作和遠(yuǎn)程倉(cāng)庫(kù)管理

撤銷操作:

創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),梁平企業(yè)網(wǎng)站建設(shè),梁平品牌網(wǎng)站建設(shè),網(wǎng)站定制,梁平網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,梁平網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

注意:Git的有些撤消操作是不可逆的。 這是在使用Git的過(guò)程中,會(huì)因?yàn)椴僮魇д`而導(dǎo)致之前的工作丟失的少有的幾個(gè)地方之一

取消暫存的文件

git add a.py b.py 

git status 

    On branch master

    Changes to be committed:

      (use "git reset HEAD <file>..." to unstage)           #提示如何撤銷

    modified:   a.py

    modified:   b.py

git reset HEAD b.py                                         #取消暫存b.py

    Unstaged changes after reset:

    M b.py

git status 

    On branch master

    Changes to be committed:

      (use "git reset HEAD <file>..." to unstage)

    modified:   a.py

    Changes not staged for commit:

      (use "git add <file>..." to update what will be committed)

      (use "git checkout -- <file>..." to discard changes in working directory)         #提示可以撤銷對(duì)文件的修改

    modified:   b.py

撤消對(duì)文件的修改

    git checkout b.py

    git status 

        On branch master

        Changes to be committed:

          (use "git reset HEAD <file>..." to unstage)

        modified:   a.py

git checkout -- [file] 是一個(gè)危險(xiǎn)的命令,如果執(zhí)行了這個(gè)命令你對(duì)那個(gè)文件做的任何修改都會(huì)消失

遠(yuǎn)程倉(cāng)庫(kù):

    遠(yuǎn)程倉(cāng)庫(kù)是指托管在因特網(wǎng)或其他網(wǎng)絡(luò)中的你的項(xiàng)目的版本庫(kù),遠(yuǎn)程倉(cāng)庫(kù)可以有多個(gè),通常有些倉(cāng)庫(kù)對(duì)你只讀,有些則可以讀寫(xiě)

    管理遠(yuǎn)程倉(cāng)庫(kù)包括了解如何添加遠(yuǎn)程倉(cāng)庫(kù)、移除遠(yuǎn)程倉(cāng)庫(kù)、管理不同的遠(yuǎn)程分支并定義它們是否被跟蹤等等

查看遠(yuǎn)程倉(cāng)庫(kù)

    git remote              #查看當(dāng)前所有的遠(yuǎn)程倉(cāng)庫(kù)

        origin              #origin 是Git給你克隆的倉(cāng)庫(kù)服務(wù)器的默認(rèn)名字

    -v選項(xiàng),顯示遠(yuǎn)程倉(cāng)庫(kù)的簡(jiǎn)寫(xiě)與其對(duì)應(yīng)的URL

    git remote -v

        origin https://github.com/libgit2/libgit2 (fetch)

        origin https://github.com/libgit2/libgit2 (push)

添加遠(yuǎn)程倉(cāng)庫(kù)

git remote add <shortname> <url>            #添加一個(gè)新的遠(yuǎn)程Git倉(cāng)庫(kù),同時(shí)指定一個(gè)簡(jiǎn)寫(xiě)

git remote add test https://github.com/huyuan1999/17-10-22.git          #添加遠(yuǎn)程倉(cāng)庫(kù)

git remote -v

    origin https://github.com/libgit2/libgit2 (fetch)

    origin https://github.com/libgit2/libgit2 (push)

    test https://github.com/huyuan1999/17-10-22.git (fetch)

    test https://github.com/huyuan1999/17-10-22.git (push)

現(xiàn)在可以在命令行中使用test來(lái)代替整個(gè)URL

    git fetch test          #拉取遠(yuǎn)程倉(cāng)庫(kù)中的信息(本地工作目錄中沒(méi)有的信息)

從遠(yuǎn)程倉(cāng)庫(kù)中抓取與拉取

    git fetch [remote-name]     #拉取遠(yuǎn)程倉(cāng)庫(kù)中的數(shù)據(jù)(不會(huì)自動(dòng)合并分支)

    如果使用clone命令克隆了一個(gè)倉(cāng)庫(kù),并將其添加為遠(yuǎn)程倉(cāng)庫(kù)默認(rèn)以origin為簡(jiǎn)寫(xiě)。所以git fetch origin會(huì)抓取克隆后新推送的所有數(shù)據(jù)

    git pull [remote-name]      #自動(dòng)的抓取然后合并遠(yuǎn)程分支到當(dāng)前分支

    默認(rèn)情況下git clone會(huì)自動(dòng)設(shè)置本地master分支跟蹤克隆的遠(yuǎn)程倉(cāng)庫(kù)master分支,運(yùn)行g(shù)it pull通常會(huì)從克隆的服務(wù)器上抓取數(shù)據(jù)并自動(dòng)嘗試合并到當(dāng)前分支

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

    git push [remote-name] [branch-name]            #推送指定分支到服務(wù)器中

    git push test master              #git默認(rèn)使用github做為遠(yuǎn)程倉(cāng)庫(kù)服務(wù)器,如果想要推送到遠(yuǎn)程倉(cāng)庫(kù)則需要有對(duì)應(yīng)的賬號(hào)和密碼

查看遠(yuǎn)程倉(cāng)庫(kù)

git remote show test

    * remote test                               #本地簡(jiǎn)寫(xiě)

      Fetch URL: https://github.com/huyuan1999/17-10-22.git

      Push  URL: https://github.com/huyuan1999/17-10-22.git

      HEAD branch: master                       #處于的分支                

      Remote branch:

        master tracked                          #掌握跟蹤

      Local ref configured for 'git push':

        master pushes to master (up to date)

遠(yuǎn)程倉(cāng)庫(kù)的移除與重命名

    git remote rename test hu               #重命名

    git remote

        origin

        hu

    git remote rm hu                        #移除

    git remote

        origin

網(wǎng)頁(yè)題目:Git基礎(chǔ)入門(mén)(七)Git撤銷操作和遠(yuǎn)程倉(cāng)庫(kù)管理
URL地址:http://www.rwnh.cn/article2/jiecoc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開(kāi)發(fā)、商城網(wǎng)站外貿(mào)網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站移動(dòng)網(wǎng)站建設(shè)、電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)
读书| 丰都县| 绥阳县| 于田县| 仁寿县| 宽城| 大安市| 红原县| 博湖县| 四子王旗| 威宁| 康马县| 曲水县| 扎赉特旗| 章丘市| 石首市| 三台县| 华池县| 元氏县| 墨江| 凉城县| 类乌齐县| 修水县| 河北区| 邵武市| 温泉县| 天台县| 海口市| 刚察县| 辉县市| 包头市| 金溪县| 奉节县| 桂平市| 沂南县| 进贤县| 涿鹿县| 奈曼旗| 云南省| 德惠市| 离岛区|