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:
- i working on local
master
branch. - i created , switched new
fcwdetection
branch adding code, using ide, meaning not through command line. - the ide has asked me add new files created (say
a.php
) repository. i've added , modifiedb.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
Post a Comment