git - Messing up with branches, old master branch shows files from the new branch? -


as can understand i'm still learning git , how branch works. anyways:

  1. i working on local master branch.
  2. i created , switched new fcwdetection branch adding code, using ide, meaning not through command line.
  3. the ide has asked me add new files created (say a.php) repository. i've added , modified b.php (which added).

the result master branch (i switched it) has a.php , b.php has same edits b.php in fcwdetection branch.

how possible? error ide or misunderstood how branch work?

your workflow seems correct. looks error in ide. if want have modified files in fcwdetection branch should commit them while you're in branch. in command line that:

create branch:

git checkout -b fcwdetection 

edit a.php , create b.php add files, included new b.php git:

git add -a . 

commit them in fcwdetection:

git commit -m 'commit message' 

at point if check in master see old versions of files:

git checkout master 

if keep seeing the modified versions of a.php , b.php should check state, them added index? beause git don't let switch branch modified non-commited files, in command line error:

error: local changes following files overwritten checkout: [some files] please, commit changes or stash them before can switch branches.  aborting 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -