git stash和git stash pop

來源:互聯網
上載者:User

zz: http://blog.csdn.net/herbert5069/article/details/6859563

 

$Git stash 可用來暫存當前進行中的工作, 比如想pull 最新代碼, 又不想加新commit, 或者另外一種情況,為了fix 一個緊急的bug,  先stash, 使返回到自己上一個commit, 改完bug之後再stash pop, 繼續原來的工作。
基礎命令:
$git stash
$do some work
$git stash pop

進階:
當你多次使用’git stash’命令後,你的棧裡將充滿了未提交的代碼,這時候你會對將哪個版本應用回來有些困惑,’git stash list’命令可以將當前的Git棧資訊列印出來,你只需要將找到對應的版本號碼,例如使用’git stash apply stash@{1}’就可以將你指定版本號碼為stash@{1}的工作取出來,當你將所有的棧都應用回來的時候,可以使用’git stash clear’來將棧清空

聯繫我們

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