2

Possible Duplicate:
How to merge a branch into another with override option in git

I have some folders on a branch, I want them to just override the same folders on master.

I dont want to go through merge.. I just want a straight replace.

Any ideas how to do this in Git? Thanks

Community
  • 1
  • 1

3 Answers3

5

This is really quite simple:

git checkout master
git checkout <branch> -- <directory>

The first command puts you on master. The second takes all the diffs between <branch> and master in <directory> and stages them for commit.

Now just issue git commit as you normally would.

Christopher
  • 40,100
  • 10
  • 77
  • 96
0

Delete master. And commit new files to it.

pain.reign
  • 361
  • 2
  • 4
  • 17
0

Try something like this:

  1. Create patch:

    git diff master mybranch path/to/folder > foo.patch

  2. Checkout to master and apply it:

    patch -p1 < foo.patch

defuz
  • 25,583
  • 9
  • 37
  • 60