When you use Git svn, when you commit a record, some of the file changes do not require a commit.
When Git svn dcommit to SVN, the local directory must be saved as clean. So we need to do stash, and then in Dcommit
After Dcommit, you need to stash aply in git
have been using git stash and git stash apply
But there has been no in-depth research, today found that git stash is going to overwrite the previous stash
git stash--help View Help manual
Or check the website's Help manual for more details https://git-scm.com/book/en/v1/Git-Tools-Stashing
Use git stash if you want to record the current state of the working directory and the index, but want to go BA CK to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
The modifications stashed away by this command can is listed with git stash list, inspected with git stash sh ow, and restored (potentially on top of a different commits) with git stash apply. Calling git stash without any arguments are equivalent to git stash save. A stash is by default listed as "WIP on branchname ...", but can give a more descriptive message on the command Line when you create one.
The latest stash you created are stored in Refs/stash; Older stashes is found in the reflog of this reference and can be named using the usual Reflog syntax (e.g. [email PR OTECTED]{0} is the most recently created stash, [e-mail Protected]{1} is the one before it,[email protect Ed]{2.hours.ago} is also possible).
git stash List
View all previously cached stash
$ git Stash list
[Email protected] {0}: WIP on temp:36b0f5f Delete Extra code in Hsdataframemanager class//second stash, overwrite first "git stash apply, only this time, last time not appear"
[Email protected] {1}: WIP on temp:36b0f5f Delete Extra code in Hsdataframemanager class//First time stash
[Email protected] {2}: The message type is printed when the WIP on Temp:c723e17 receives the message, if there is a message inside
[Email protected] {3}: When the WIP on TEMP:18FA2A3 connects the Communication module, the window handle of the main form needs to be passed to the communication
Temp is the name of the branch
The No. 0 and 1th though look exactly the same but are actually different
Git stash Show
View one of the stash in the list
$ git stash show [email protected]{0}
Zbmyun/sourcecode/zitakerhs/zitaker/systemconfig.ini | 2 +-
1 file changed, 1 insertion (+), 1 deletion (-)
$ git stash show [email protected]{1}
Zbmyun/sourcecode/zitakerhs/zitaker/ui/main.cs | 2 +-
Zbmyun/sourcecode/zitakerhs/zitaker/zbmstorage_component.ini | 2 +-
2 files changed, 2 insertions (+), 2 deletions (-)
git stash Apply
Can apply the specified stash, if you do not specify, the default to apply the last stash
If you want to apply one of the older stashes, you can specify it by naming it, like this: git stash apply [email protected]{2}
.
If you don ' t specify a stash, Git assumes the most recent stash and tries to apply it:
The use of Git stash