I have master branch of the project. Then I want to add a new feature so I create a new branch called "new_feature", base on master branch. In new_feature branch, everything works fine and I want to delete some files that are no longer useful. But when I switch back to master branch and merge with new_feature branch, these deleted files still exist. Here is my question: what I have to do to make master branch is exactly the same as the new_feature branch so I can delete new_feature branch. Thanks in advance!
3 Answers
You need merge new_feature
branch to master
.
The steps are,
- Switch to
master
branch - Team - Merge, select
new_feature
branch

- 8,035
- 7
- 46
- 75
@Duc Le: You must merge your new_feature branch to your master branch to get all modified file in new_feature branch into master branch.
Maybe something like this you can follow :
Check your branch :
$ git branch
new_feature * (your active branch)
masterSwitch to your master branch :
$ git checkout master
Merge your new_feature to master branch without fast-forward mode:
$ git merge --no-ff new_feature

- 1
- 1

- 1,120
- 1
- 8
- 11
-
Sorry, but I don't use Git command line. I use EGit instead, a plugin of Eclipse. – Duc Le Apr 01 '12 at 08:25
-
Owh ic, maybe you can read about merging in egit in http://wiki.eclipse.org/EGit/User_Guide#Merging :) – martinusadyh Apr 01 '12 at 08:34
Sounds like you forgot to check in the delete. In Eclipse, switch to the feature branch and open the Git Staging view to see changes that are still pending. File deletes get staged automatically, but not committed.
Required sequence is
Delete - commit - push - checkout other branch - merge - commit - push

- 5,464
- 26
- 30
-
Oops, I can't do it before. Now it works like magic. Maybe I forgot to commit the the deleted files. – Duc Le Apr 01 '12 at 13:39