GIT: Checkout to other branch without doing a commit or stage the files in the first branch -


i beginner @ git. have file changes , need checkout other branch. clarify file exists in both branches. when checkout git says:

  1. the checkout cannot done because have changes not committed in first branch , these files overridden

  2. other times git allows me checkout second branch without doing commit or stage files in first branch

why git doesn't allow me checkout , why does?

thanks

if there conflicts between changes , branch, git reasonably refuse clobber 1 or other. way around stash changes, apply stash (assuming wanted changes in newly checked out branch):

> git stash save > git checkout <brannchname> > git stash pop 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -