Eclipse Git : auto-synchronising 2 branches -


i working on project mates.

yesterday cloned project intention add functionality.
have 2 local branches develop (the main branch) , pagecontent (my feature branch).

the problem encountering when edit on feature branch, automatically edits on developp branch (i did not commit anything).

i checked out on developp branch delete edition , when checked out on feature branch, edition deleted ...

the branches seem auto-synchronised.

i checked out on develop branch delete edition , when checked out on feature branch, edition deleted ...

this how git works.


in following diagram can see 3 states.
git has 3 main states files can reside in.

enter image description here


they shared between branches. when checkout branch change head end staging area && working directory shared between repository when checkout branches.


since did not commit (i assume happened) when switch branches see changes following new branch.

if don't want changes follow you need commit (or stash) work before switching branch.

how checkout different branch clean working directory , stage area?

if wish checkout clean branch without "leftovers" in working directory , staging can create new worktree result in shared view of repository (all content shared) different working directory , staging area.


from git v2.5

git worktree add <new_path> 

now whatever want in of branches. create 2 separate working folders separated each other while pointing same repository.

using wortree don't have clear or reset in order remove staged , untracked content.

here demo of how it:

enter image description here



Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -