git commit - Git discarded uncommitted changes after checkout -
as far know git checkout doesn't allow checkout branch until commit previous changes changes have been discarded.
i executed git status command , showed me list of modified files. executed git checkout . (dot) command didn't prompt me first commit previous changes , discarded changes , checked out master branch on local machine.
can please guide me why git checkout . behaved in way? , how can move previous code on local machine (with modified , uncommitted changes)? why did discard changes?
unfortunately, git checkout command has several different meanings, , has caused problem: checkout can switch branches, create branch, update working directory files specific version or head of branch.
when do: git checkout <branchname>, ask git switch branch, warn if have uncommitted changes can remove, stash or commit.
when do: git checkout <pathname>, ask git update files version, ask git override potential modifications in repository; git did.
hope it'll help. sorry discarded changes. simplicity of ui important.
Comments
Post a Comment