Git stash uncached: how to put away all unstaged changes?

前端 未结 4 786
孤城傲影
孤城傲影 2021-01-30 00:27

Suppose two set of changes are made in a project versioned by git. One set is staged and the other is not.

I would like to recheck staged changes by running my project a

4条回答
  •  半阙折子戏
    2021-01-30 00:59

    Git: Stash unstaged changes

    This will stash all modifications that you did not git add:

    git stash -k
    

    Note that newly created (and non-added) files will remain in your working directory unless you also use the -u switch.

    git stash -k -u 
    

    Also, your working directory must be clean (i.e. all changes need to be added) when you git stash pop later on.

    http://makandracards.com/makandra/853-git-stash-unstaged-changes

提交回复
热议问题