Git Closet: A Dilemma

I experience weird behavior with git stash, I have two branches v0 and v1, v0 is in a stream with my main branch as well as a remote repo copy, and v1 is the one I checked that looked like v0, but Now I have some changes to this. So now v1 is different from v0.

Now I want to see what is in v0, and therefore I do git stash on the v1 branch, and then checkout to v0, but it seems that all the changes that I had in v1 now map to v0, and now v0 and v1 both are in the sink with each other, but they are not in the sink with the repo replica removed.

Any guidance or suggestion on what might be possible for this?

Updated :

Depending on the provided answer, I have a question related to it, for example: What does git stash pop do here and how does it differ from git stash apply, we also have something like git stash push, it seems that git bookmarks functionality is similar to the structure stack data

Thank!!!

+3
source share
2 answers

I think you had new files on v1 that you did not add git to. git stash only affects files that are part of the repository, so it did not reset your new files or touch their switch. Go back to v1, git stash pop, git add the files, git, then again, and you will go well.

+3
source
  • git stash push ", , refspecs , . , , , .
  • pop apply, drop, . , .
0

Source: https://habr.com/ru/post/1732577/


All Articles