【轉】Git Stash的使用方法

來源:互聯網
上載者:User

標籤:

命令:git stash
1.使用gitstash儲存當前的工作現場,那麼就可以切換到其他分支進行工作,或者在當前分支上完成其他緊急的工作,比如修訂一個bug測試提交。
2.如果一個使用了一個git stash,切換到一個分支,且在該分支上的工作未完成也需要儲存它的工作現場。再使用gitstash。那麼stash 隊列中就有了兩個工作現場。
3.可以使用git stash list。查看stash隊列。
4.如果在一個分支上想要恢複某一個工作現場怎麼辦:先用git stashlist查看stash隊列。確定要恢複哪個工作現場到當前分支。然後用git stash pop [email protected]{num}。num就是你要恢複的工作現場的編號。
5.如果想要清空stash隊列則使用git stash clear。
6.同時注意使用git stashpop命令是恢複stash隊列中的[email protected]{0}即最上層的那個工作現場。而且使用pop命令恢複的工作現場,其對應的stash在隊列中刪除。使用git stash apply [email protected]{num}方法除了不在stash隊列刪除外其他和git stashpop 完全一樣。

 

轉自:http://blog.sina.com.cn/s/blog_682d2aaf01016d9d.html

【轉】Git Stash的使用方法

相關文章

聯繫我們

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