Switching branches carries uncommitted changes with you. Either commit first, run git checkout .
to undo them, or run git stash
before switching. (You can get your changes back with git stash apply
)
More Related Contents:
- How to fetch all Git branches
- Where do the settings in my Git configuration come from?
- How to configure Git for using it with Dropbox?
- Git Init in home directory – now unable to commit changes
- Does github remember commit IDs?
- git add * (asterisk) vs git add . (period)
- How do I programmatically determine if there are uncommitted changes?
- git difftool, open all diff files immediately, not in serial
- Prevent commits in master branch
- git: Apply changes introduced by commit in one repo to another repo
- How to sort git tags by version string order of form rc-X.Y.Z.W?
- Git clone: Redirect stderr to stdout but keep errors being written to stderr
- .gitattributes & individual merge strategy for a file
- What does ^{} mean in git?
- Git keyword substitution like those in Subversion?
- When listing git-ls-remote why there’s “^{}” after the tag name? [duplicate]
- After git push origin main, nothing happens
- how can I customize git’s merge commit message?
- Which are the plumbing and porcelain commands?
- How can I view file history in Git?
- Which characters are illegal within a branch name?
- git whitespace woes
- Git pushing to remote GitHub repository as wrong user
- Error: Cannot pull with rebase: You have unstaged changes
- Git rebase branch with all parent branches (or dependent sub-branches)
- Remove a git commit which has not been pushed
- How do I deal with corrupted Git object files?
- github: server certificate verification failed
- VS Code / Bitbucket / SSH – Permission denied (publickey)
- How do I write a batch file which opens the GitBash shell and runs a command in the shell?