Git - temporarily save current work

后端 未结 2 1975
萌比男神i
萌比男神i 2021-01-05 23:01

I\'m adding a feature on master branch. After changing several files, I realize that I need to check the output without my changes.

The way I can think of is:

<
2条回答
  •  旧时难觅i
    2021-01-05 23:34

    This is exactly what stashing is designed for.

    Basically:

    1. Use git stash save to save your changes in a side location (i.e., the stash)
    2. Check whatever you want, fix if needed, and commit
    3. Use git stash pop to return your changes to the working directory.

提交回复
热议问题