Git 提交更改

來源:互聯網
上載者:User

標籤:cat   提交   ring   ret   yii   key   ash   tom   arc   

Jerry 已經提交的更改,他想糾正他的最後一次提交,在這種情況下,git 的修改將協助操作。最後提交修改操作的變化,包括提交資訊,它建立新的提交ID。

修改操作之前,他會檢查提交日誌。

[[email protected] project]$ git log

上面的命令會產生以下結果。

commit cbe1249b140dad24b2c35b15cc7e26a6f02d2277 Author: Jerry Mouse <[email protected]> Date: Wed Sep 11 08:05:26 2013 +0530 Implemented my_strlen function commit 19ae20683fc460db7d127cf201a1429523b0e319 Author: Tom Cat <[email protected]> Date: Wed Sep 11 07:32:56 2013 +0530 Initial commit

Jerry 提交了新的變化 – 修改操作,並查看提交日誌。

[[email protected] project]$ git status -s M string.c ?? string [[email protected] project]$ git add string.c [[email protected] project]$ git status -s M string.c ?? string [[email protected] project]$ git commit –amend -m ‘Changed return type of my_strlen to size_t’ [master d1e19d3] Changed return type of my_strlen to size_t 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 string.c

現在 git 的日誌,將顯示新的提交資訊與新的提交ID

[[email protected] project]$ git log

上面的命令會產生以下結果。

commit d1e19d316224cddc437e3ed34ec3c931ad803958 Author: Jerry Mouse <[email protected]> Date: Wed Sep 11 08:05:26 2013 +0530 Changed return type of my_strlen to size_t commit 19ae20683fc460db7d127cf201a1429523b0e319 Author: Tom Cat <[email protected]> Date: Wed Sep 11 07:32:56 2013 +0530 Initial commit

 

PS:如果您想和業內技術大牛交流的話,請加qq群(521249302)或者關注公眾 號(AskHarries),謝謝!

Git 提交更改

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.