git學習(3)

來源:互聯網
上載者:User

標籤:

繼續對readme.txt做以下修改:

Git is a distributed version control system.Git is free software distributed under the GPL.

然後使用git add和git commit提交到倉庫。
檔案經過很多次修改,git對每次commit進行記錄,當檔案改亂或者檔案誤刪,都可以從最近的一次commit恢複。
使用命令git log可以查看檔案曆史修改記錄。顯示從最近到最遠的提交日誌,
得到的日誌資訊中,commit後的數字是commit的版本號碼,

版本回退:
Git中,用HEAD表示目前的版本,其對應一個版本號碼,上一個版本就是HEAD^,上上個版本是HEAD^^,第20個版本是HEAD~20。
使用命令git reset回退到上一個版本:
git reset --hard HEAD^
此時用git log,已經看不到append GPL的版本了,

要想回到append GPL版本,
1,可以使用
git reset --hard 版本號碼
版本號碼只需要完整版本號碼的前幾位即可,
如果忘記了版本號碼怎麼辦?
2,可以使用
git reflog
記錄每次命令的資訊,有版本號碼。

git學習(3)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.