0

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!

Duc Le
  • 347
  • 2
  • 4
  • 14

3 Answers3

1

You need merge new_feature branch to master.

The steps are,

  1. Switch to master branch
  2. Team - Merge, select new_feature branch
Kane
  • 8,035
  • 7
  • 46
  • 75
0

@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 :

  1. Check your branch :

    $ git branch
    new_feature * (your active branch)
    master

  2. Switch to your master branch :

    $ git checkout master

  3. Merge your new_feature to master branch without fast-forward mode:

    $ git merge --no-ff new_feature

Explanation about merging without fast-forward

Community
  • 1
  • 1
martinusadyh
  • 1,120
  • 1
  • 8
  • 11
0

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

soru
  • 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