Why when I make a change in 'X' branch my master branch is changing as well in the same way?

人走茶凉 提交于 2019-12-02 09:50:19

When you make a change in your editor, you only modify the code in your "working directory". When you switch branches, those changes in your "dirty" directory come along for the ride.

Once you commit your changes on a given branch, switching branches will no longer bring those changes over.

When you make a change in your editor, you only modify the code in your "working directory". When you switch branches, those changes in your "dirty" directory come along for the ride.

Once you commit your changes on a given branch, switching branches will no longer bring those changes over.

(Answer By @Joseph Silber)

Before your case you have three options to make:

A) Maintain changes in the master branch

# Agree 
git add file/path/archive
# Perfom a commit
git commit -m "Message"

B) Return branch employee and add changes in this branch

# Since the terminal gitbash or the manually form
git checkout employee
# Agree 
git add file/path/archive
# Perfom a commit
git commit -m "Message" 

C) Discard all change

This step will undo all changes that have not been previously added to a commit. Caution!!.

git checkout file/path/archive
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!